PennyLaneAI / PennyLaneAI/catalyst

Failing Tests in `Test_OpenQasmDevice.cpp` when installing on MacOS

Open
#1,184 19 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

Issue description

Expected behavior

When following the installation guide on https://docs.pennylane.ai/projects/catalyst/en/stable/dev/installation.html#minimal-building-from-source-guide for MacOS, after the step make test all tests should pass.

Actual behavior
  • After executing make test the last lines of the output are the following:
-------------------------------------------------------------------------------
Test PSWAP and ISWAP with BuilderType::Braket
-------------------------------------------------------------------------------
/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/runtime/tests/Test_OpenQasmDevice.cpp:529
...............................................................................

/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/runtime/tests/Test_OpenQasmDevice.cpp:529: FAILED:
due to unexpected exception with message:
  ModuleNotFoundError: No module named 'braket'

At:
    <string>(3): <module>

===============================================================================
test cases:  33 |  28 passed |  5 failed
assertions: 177 | 151 passed | 26 failed

make[1]: *** [test] Error 26
make: *** [test-runtime] Error 2
System information

Machine: Mac M1, Mac M2, Mac M3, with MacOS 15.0.1 installed.
Python used in a virtualenv: 3.11.9 and 3.12.6

The output of import pennylane as qml; qml.about():

Name: PennyLane
Version: 0.39.0.dev26
Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
Home-page: https://github.com/PennyLaneAI/pennylane
Author:
Author-email:
License: Apache License 2.0
Location: /Users/yannick/.pyenv/versions/catalyst/lib/python3.11/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing-extensions
Required-by: amazon-braket-pennylane-plugin, PennyLane-Catalyst, PennyLane_Lightning, PennyLane_Lightning_Kokkos

Platform info:           macOS-15.0.1-arm64-arm-64bit
Python version:          3.11.9
Numpy version:           2.0.0
Scipy version:           1.13.0
Installed devices:
- default.clifford (PennyLane-0.39.0.dev26)
- default.gaussian (PennyLane-0.39.0.dev26)
- default.mixed (PennyLane-0.39.0.dev26)
- default.qubit (PennyLane-0.39.0.dev26)
- default.qutrit (PennyLane-0.39.0.dev26)
- default.qutrit.mixed (PennyLane-0.39.0.dev26)
- default.tensor (PennyLane-0.39.0.dev26)
- null.qubit (PennyLane-0.39.0.dev26)
- reference.qubit (PennyLane-0.39.0.dev26)
- lightning.qubit (PennyLane_Lightning-0.39.0.dev38)
- nvidia.custatevec (PennyLane-Catalyst-0.9.0.dev30)
- nvidia.cutensornet (PennyLane-Catalyst-0.9.0.dev30)
- oqc.cloud (PennyLane-Catalyst-0.9.0.dev30)
- softwareq.qpp (PennyLane-Catalyst-0.9.0.dev30)
- lightning.kokkos (PennyLane_Lightning_Kokkos-0.39.0.dev38)
- braket.aws.ahs (amazon-braket-pennylane-plugin-1.30.1)
- braket.aws.qubit (amazon-braket-pennylane-plugin-1.30.1)
- braket.local.ahs (amazon-braket-pennylane-plugin-1.30.1)
- braket.local.qubit (amazon-braket-pennylane-plugin-1.30.1)
Additional information
  • On Ubuntu this behavour could not be reproduced and everything has worked as expected.
  • After installing the libraries into the system python version the test went through on one machine. Hence, the assumption is that for those tests the system python version is used instead of the version from the virtual environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with catalyst/runtime/tests/Test_OpenQasmDevice.cpp, especially the Braket-related test around line 529, and reproduce the failure with make test using the documented macOS virtualenv setup. Compare how the test resolves Python and the braket module against the installation guide and the reported system-Python workaround. Done means the affected tests pass in the supported virtualenv setup without relying on an unrelated system installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.