Skip to main content
3 votes
Accepted

How do I compile a circuit to the native gateset of Quantinuum's trapped-ion devices?

You can do this with the pytket-quantinuum extension. This is installed as a separate python package. I'll show an example. First I'll build a quantum circuit and then compile it to the native gateset....
Callum's user avatar
  • 1,065
3 votes
Accepted

How to define a custom gate from a matrix in TKET

You can define custom parametrised gates in pytket using CustomGateDef. Here the CustomGate is defined using a circuit which ...
Callum's user avatar
  • 1,065
3 votes
Accepted

Does pytket have an optimization pass that removes gate-inverse pairs & identity rotations & redundant gates and/or merges rotations?

Yes, you can use the pytket RemoveRedundancies pass: pytket manual RemoveRedundancies().apply(circ.measure_all()) This should give a total of five reductions in ...
KSp's user avatar
  • 106
2 votes
Accepted

How do I apply an arbitrarily-phased single qubit gate in pytket?

I see that you did figure out that pytket supports the U1(angle) gate which is another name for the P(angle) gate. To add this gate you need the OpType enum. This is sometimes the case with less ...
KSp's user avatar
  • 106
1 vote
Accepted

Is this possible to reset a single qubit that is part of a larger register in pytket?

Great question, it turns out that add_gate takes a list of unit ids pytket add_gate Hence try: qc.add_gate(OpType.Reset,[q_register[0]])
KSp's user avatar
  • 106
1 vote
Accepted

pytket compiler pass to shorten all angles by multiples of 2 pi

Based on Callums feedback I wrote a function for a CustomPass. ...
Phil's user avatar
  • 135
1 vote

Pytket's SquashTK1 pass changes symbolic parameters of gates into complicated expressions

Squashing symbolic gates with optimisation passes like SquashTK1 frequently leads to lengthy trigometric expresions. See the pytket user manual for some background. However in this case its possible ...
Callum's user avatar
  • 1,065
1 vote
Accepted

How to specify custom gate set for the optimization in pytket?

Yes it is possible to get pytket to give you a circuit in the desired gateset. The simple case In certain cases this can be done automatically with the auto_rebase_pass. This auto rebase depends on a ...
Callum's user avatar
  • 1,065
1 vote
Accepted

How to set different Backend Layouts in TKET and pyQuil (Quil compiler)?

If I understand your question correctly I think you should look into TKET's architecture module. https://cqcl.github.io/tket/pytket/api/architecture.html You can for example define a ...
Callum's user avatar
  • 1,065

Only top scored, non community-wiki answers of a minimum length are eligible