cuQuantum icon indicating copy to clipboard operation
cuQuantum copied to clipboard

`CircuitToEinsum` fails for some qiskit `QuantumCircuit`

Open derwind opened this issue 2 years ago • 1 comments

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)

derwind avatar Nov 06 '23 15:11 derwind

Thanks for reporting the issue. This is under our radar and we will address it in our next release.

yangcal avatar Nov 07 '23 01:11 yangcal

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)

nathanieltornow avatar May 23 '24 17:05 nathanieltornow

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

yangcal avatar May 23 '24 17:05 yangcal