QuantestPy / quantestpy

Apache License 2.0
9 stars 3 forks source link

Toffoli gate in a Qiskit circuit is decomposed into H, T etcetc when converted to a QuantestPy circuit, resulting in that the PauliCircuit class cannot deal with the circuit #189

Open junnaka51 opened 1 year ago

junnaka51 commented 1 year ago

A Toffoli gate with a control value different from 1, in Qiskit

from qiskit import QuantumCircuit, assemble

qc = QuantumCircuit(4)
qc.ccx(0, 1, 2, "10")
qc.draw()
Out[7]: 

q_0: ──o──
       │  
q_1: ──■──
     ┌─┴─┐
q_2: ┤ X ├
     └───┘
q_3: ─────

qobj = assemble(qc)
qobj_dict = qobj.to_dict()
experiments = qobj_dict["experiments"][0]  # [0] changes list into dict.
gates = experiments["instructions"]
gates
Out[12]: [{'name': 'ccx_o2', 'qubits': [0, 1, 2]}]