Interfacing with Qiskit

import trueq as tq

# Define a circuit.
circuit = tq.Circuit(
    [
        tq.Cycle({(0,): tq.Gate.x, (1,): tq.Gate.y}),
        tq.Cycle({(0, 2): tq.Gate.cz, (1,): tq.Gate.x}),
        tq.Cycle({(3,): tq.Gate.h, (5,): tq.Gate.s}),
    ]
)

# Create a Qiskit instance of the circuit.
qiskit_circuit = circuit.to_qiskit()
# Now we can use Qiskit's toolkit with qiskit_circuit.
# For example, we can draw a circuit diagram.
qiskit_circuit.draw()
     ┌───────────────────┐  ░                          ░
q_0: ┤ U3(pi,-pi/2,pi/2) ├──░──■───────────────────────░─────────────
     ├───────────────────┴┐ ░  │ ┌───────────────────┐ ░
q_1: ┤ U3(pi,-3pi/2,pi/2) ├─░──┼─┤ U3(pi,-pi/2,pi/2) ├─░─────────────
     └────────────────────┘ ░  │ └───────────────────┘ ░
q_2: ───────────────────────░──■───────────────────────░─────────────
                            ░                          ░ ┌──────────┐
q_3: ───────────────────────░──────────────────────────░─┤ U2(0,pi) ├
                            ░                          ░ └──────────┘
q_4: ───────────────────────░──────────────────────────░─────────────
                            ░                          ░ ┌──────────┐
q_5: ───────────────────────░──────────────────────────░─┤ U1(pi/2) ├
                            ░                          ░ └──────────┘


Total running time of the script: ( 0 minutes 0.024 seconds)

Gallery generated by Sphinx-Gallery