cuQuantum
cuQuantum copied to clipboard
`CircuitToEinsum` fails for some qiskit `QuantumCircuit`
Informations
Python 3.10.12 (Google Colab) qiskit 0.45.0 qiskit-terra 0.45.0 cuquantum-python 23.10.0 cuquantum-python-cu11 23.10.0
What is the current behavior?
Recently, qiskit 0.45.0 was released. According to its release note:
Starting in this release, all unparametrized gates in the Qiskit standard circuit library are now singletons.
This changed the type of CXGate
from <class 'qiskit.circuit.library.standard_gates.x.CXGate'>
to <class '_SingletonCXGate'>
.
So, get_decomposed_gates
of circuit_parser_utils_qiskit.py fails if CXGate
is used since the condition of #L42 is now False
: if 'standard_gate' in str(type(operation)) or isinstance(operation, UnitaryGate):
Steps to reproduce the problem
Executing snippets below leads to AttributeError: 'NoneType' object has no attribute 'qubits'
at #L56.
from qiskit import QuantumCircuit
from cuquantum import CircuitToEinsum
qc = QuantumCircuit(2)
qc.cx(0, 1)
converter = CircuitToEinsum(qc)