`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)
Thanks for reporting the issue. This is under our radar and we will address it in our next release.
Hi all, I came across the same issue in version 23.10 (docker image), but in the newest version (24.03) it works again :) So, I think we can close this issue.
(Maybe we could also update the official website to point to the new version)
Hello all,
Sorry that we forgot to update the ticket. In cuquantum-python 24.03, we have fixed the bug, see the release notes here. Our newest 24.03 docker container was just recently released and so glad that @nathanieltornow have found this out. We will be soon updating the doc page to point to the latest appliance container. I will mark this issue closed.
Cheers, Yang