Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support azure-quantum[qiskit] installation on macOS M2 #443

Open
suzuki-r opened this issue Mar 23, 2023 · 0 comments
Open

Support azure-quantum[qiskit] installation on macOS M2 #443

suzuki-r opened this issue Mar 23, 2023 · 0 comments

Comments

@suzuki-r
Copy link

suzuki-r commented Mar 23, 2023

I am trying to install azure-quantum in Apple Mac M2 under pyenv-virtualenv, and found the following trouble. When I run the code

from azure.quantum.qiskit import AzureQuantumProvider

as in this instruction, I encounter

File ~/.pyenv/versions/...../site-packages/azure/quantum/qiskit/backends/rigetti.py:16
     14 from qiskit.providers.models import BackendConfiguration
     15 from qiskit.providers import Options
---> 16 from qiskit_qir import SUPPORTED_INSTRUCTIONS as QIR_BASIS_GATES
     18 if TYPE_CHECKING:
     19     from azure.quantum.qiskit import AzureQuantumProvider
ImportError: cannot import name 'SUPPORTED_INSTRUCTIONS' from 'qiskit_qir'_

It seems that this bug has already been fixed here in GitHub. However, for ARM devices, pip cannot install the latest version of azure-quantum (ver. 0.27.258160) due to the compatibility. For example, pip selects the packages such as

  • numpy-1.24.2-cp310-cp310-macosx_11_0_arm64.whl
  • aiohttp-3.8.4-cp310-cp310-macosx_11_0_arm64.whl
  • aiofile-3.8.5-py3-none-any.whl
  • azure_quantum-0.27.238334-py3-none-any.whl

A quick-and-dirty fix would be to remove the line

from qiskit_qir import SUPPORTED_INSTRUCTIONS as QIR_BASIS_GATES

from microsoft.py, qci.py and rigetti.py by hand. Incidentally, I also found

from qiskit_qir.visitor import SUPPORTED_INSTRUCTIONS as QIR_BASIS_GATES

seems to work (N.B. my job sent to IonQ has failed after waiting for a month. So this workaround may not work)

A related issue was reported here. I uninstalled and reinstalled pyqir and qiskit-qir, but it does not help. Here are my package versions;

  • python: 3.10.10
  • qiskit: 0.42.1
  • pyqir: 0.8.0
  • qiskit-qir: 0.3.1
  • azure-quantum: 0.27.238334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant