Questions tagged [pytket]

This tag is for questions relating to pytket, an open source quantum SDK developed by Quantinuum. Given that pytket has many features related to compilation the [compiling] or [transpile] tags may be appropriate to add as well. Questions relating to TKET should also be covered under this tag as the TKET compiler is usually accessed through python via pytket.

14 questions
4
votes
2 answers

Questions on multi-controlled Toffolis and their implementation in Qiskit

Is it possible to decompose an $n$-controlled Toffoli into $O(n)$ CNOTs without extra working qubits? If so, is such an decomposition currently available in Qiskit or any other (preferably Python and QASM-friendly) packages? If not: Has such an…
mavzolej
  • 2,271
  • 9
  • 18
4
votes
1 answer

How to define a custom gate from a matrix in TKET

I'm currently learning all about different quantum tools such as qiskit, tket, cirq, Forest SDK and so on. I just want to create a circuit that gets executed given a matrix, because a circuit can be written as a matrix and the other way around. In…
Qubii
  • 301
  • 1
  • 7
3
votes
1 answer

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

Suppose I have a quantum circuit defined in pytket, qiskit or some other quantum SDK. How do I compile my circuit to be in the native gateset of the Quantinuum trapped ion device/emulators?
Callum
  • 1,260
  • 1
  • 5
  • 24
2
votes
1 answer

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

For the following sample circuit I want to reduce the number of gates in pytket: for example, I know: Adjacent Rx gates can be merged CZ is self-inverse and cancels itself out because any Hermitian gate is "self-canceling" A zero-angle rotation…
mapper
  • 35
  • 3
2
votes
1 answer

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

I want to reset a single qubit that is part of a larger register. Is this possible in pytket? Resetting the single qubit qc.add_gate(OpType.Reset,q_register[0]) throws TypeError: add_gate(): incompatible function arguments. The following argument…
Qnerd
  • 23
  • 2
1
vote
0 answers

Bit ordering moving from qiskit to qulacs through pytket

I have code built in Qiskit that runs and provides the expected output on the Aer simulator. The bit ordering of the output is little-endian based on the order that the classical registers are added to the circuit. My research requires use of Qulacs…
user34741
  • 11
  • 1
1
vote
1 answer

Transpiling a circuit with Tket, taking topology into account

There is a simple circuit with one CNOT like the following: Topology 0 → 1 (directed connection) CNOT 1 → 0 Note that CNOT is placed opposite to the connection. If this is transpiled correctly, it should look like the following circuit. HH CNOT 0…
yasuhito
  • 91
  • 4
1
vote
1 answer

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

After applying some compiler passes in pytket, I get gates like rx(3.5*pi). Is there a pass that simply shortens the angles by multiples of 2 pi, so that I get rx(1.5*pi) instead?
Phil
  • 135
  • 4
1
vote
1 answer

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

I have a specific basis gate set for my system, is it possible to use pytket's predefined optimization sequences and ask it to give a final circuit using my specific gate set?
mondibrah
  • 43
  • 7
1
vote
1 answer

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

This is the specific gate I want to implement using pytket: corresponding Wikipedia page I tried: from pytket import Circuit circ = Circuit(1) circ.U1(angle) But I got the following error: pytket._tket.circuit.Circuit' object has no attribute 'U1'
mapper
  • 35
  • 3
0
votes
0 answers

(PyTket) Trouble with RoutingPass.apply() running forever -- seems to hang

I am attempting to route a circuit with 3 qubits, each connected via a 2 qubit gate that is defined using the Unitary2qBox. This sequence is repeated several times. So there are 3 choose 2 gates or 3 gates. When I attempt to route this, the…
0
votes
0 answers

Solving variables in symbolic unitary to get a desired real-valued unitary using qiskit or qympy, qiskit-symb/pytket

I am trying to decompose a 4x4 unitary into 2 qubit circuit using U3 and CNOT gates but the circuit implementation qiskit gives me is not optimized. So I started looking at qiskit-symb and qympy to see if I can design a parameterized circuit and…
0
votes
1 answer

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

For a very simple circuit, such as from pytket.circuit import Circuit, fresh_symbol a = fresh_symbol("a") circ = Circuit(1) circ.X(0) circ.Ry(a,0) the circuit that results from applying a SquashTK1 pass: from pytket import…
0
votes
1 answer

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

In Qiskit it is possible to describe a CouplingMap on which a circuit get executed. This helps with testing different Layouts. There are many possibilities in Qiskit on how to do this. Firstly you can create a CouplingMapInstance and then create…
Qubii
  • 301
  • 1
  • 7