Open junnaka51 opened 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]}]
A Toffoli gate with a control value different from 1, in Qiskit