Skip to content

Commit d2ab5bb

Browse files
Qiskit Primitives V2 Migration (#298)
* Support for Qiskit Primitives V2 * Fix for pickling PQK * Several minor fixes --------- Co-authored-by: Moritz <moritz.willmann@ipa.fraunhofer.de> Co-authored-by: Moritz Willmann <moritz.willmann@web.de>
1 parent b3d60ce commit d2ab5bb

49 files changed

Lines changed: 3554 additions & 1460 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yaml

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,120 @@ on:
55
- cron: '23 1 * * *'
66

77
jobs:
8-
pytest:
8+
pytest_minimal_requirements:
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Set up Python
14-
uses: actions/setup-python@v4
14+
uses: actions/setup-python@v5
1515
with:
1616
python-version: '3.9'
1717
- name: Install dependencies
1818
run: |
1919
python -m pip install --upgrade pip
20+
python -m venv venv_minimal
21+
source venv_minimal/bin/activate
22+
pip install toml
23+
python3 install_lowest_dependencies.py
24+
- name: Test with pytest
25+
run: |
26+
source venv_minimal/bin/activate
27+
pip install pytest
28+
pytest tests/
29+
- name: Test examples
30+
run: |
31+
source venv_minimal/bin/activate
32+
pip install nbmake
33+
pytest --nbmake --nbmake-timeout 600 examples/
34+
- name: clean
35+
run: |
36+
rm -rf venv_minimal
37+
38+
pytest_qiskit_0_46:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: '3.9'
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m venv venv_qiskit_0_46
51+
source venv_qiskit_0_46/bin/activate
52+
pip install .[examples] qiskit==0.46.3 qiskit-ibm-runtime==0.20.0
53+
- name: Test with pytest
54+
run: |
55+
source venv_qiskit_0_46/bin/activate
56+
pip install pytest
57+
pytest tests/
58+
- name: Test examples
59+
run: |
60+
source venv_qiskit_0_46/bin/activate
61+
pip install nbmake
62+
pytest --nbmake --nbmake-timeout 600 examples/
63+
- name: clean
64+
run: |
65+
rm -rf venv_qiskit_0_46
66+
67+
pytest_qiskit_1:
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Set up Python
73+
uses: actions/setup-python@v5
74+
with:
75+
python-version: '3.9'
76+
- name: Install dependencies
77+
run: |
78+
python -m pip install --upgrade pip
79+
python -m venv venv_qiskit_1
80+
source venv_qiskit_1/bin/activate
81+
pip install .[examples] qiskit==1.1.2 qiskit-ibm-runtime==0.27.1
82+
- name: Test with pytest
83+
run: |
84+
source venv_qiskit_1/bin/activate
85+
pip install pytest
86+
pytest tests/
87+
- name: Test examples
88+
run: |
89+
source venv_qiskit_1/bin/activate
90+
pip install nbmake
91+
pytest --nbmake --nbmake-timeout 600 examples/
92+
- name: clean
93+
run: |
94+
rm -rf venv_qiskit_1
95+
96+
pytest_latest:
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Set up Python
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version: |
105+
3.12
106+
- name: Install dependencies
107+
run: |
108+
python -m pip install --upgrade pip
109+
python -m venv venv_latest
110+
source venv_latest/bin/activate
20111
pip install .[examples]
21112
- name: Test with pytest
22113
run: |
114+
source venv_latest/bin/activate
23115
pip install pytest
24116
pytest tests/
25117
- name: Test examples
26118
run: |
119+
source venv_latest/bin/activate
27120
pip install nbmake
28-
pytest --nbmake --nbmake-timeout 600 examples/
121+
pytest --nbmake --nbmake-timeout 600 examples/
122+
- name: clean
123+
run: |
124+
rm -rf venv_latest

docs/install/install.rst

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ Prerequisites
99
sQUlearn requires a recent python3 (>=3.9) installation.
1010
Additionally the following python packages are necessary: ::
1111

12-
numpy>=1.17
13-
scipy>=1.5
14-
scikit-learn>=1.0
15-
qiskit>=0.42.1
12+
bayesian-optimization>=1.4.3,<2
13+
dill>=0.3.4
14+
mapomatic>=0.10.0
15+
networkx>=3.0
16+
numpy>=1.20
17+
pennylane>=0.34.0
18+
qiskit>=0.45.0
1619
qiskit-aer>=0.12.0
17-
qiskit-machine-learning>=0.6.0
18-
qiskit-ibm-runtime>=0.9
19-
dill>=0.3
20+
qiskit-algorithms>=0.3.0
21+
qiskit-ibm-runtime>=0.18.0
22+
qiskit-machine-learning>=0.7.0
23+
scipy>=1.8.0
24+
scikit-learn>=1.2.0,<1.4.2
25+
tqdm>=4.1.0
2026

2127
The packages are automatically installed when installing sQUlearn with pip.
2228

@@ -48,3 +54,28 @@ To install the latest development version:
4854
.. code-block:: bash
4955
5056
pip install git+https://github.com/sQUlearn/squlearn.git@develop
57+
58+
59+
60+
Installation with optional dependencies:
61+
----------------------------------------
62+
63+
There are several optional dependencies that can be installed with sQUlearn.
64+
To install sQUlearn with the dependencies usefull for development, run the following command:
65+
66+
.. code-block:: bash
67+
68+
pip install squlearn[dev]
69+
70+
To install sQUlearn with the dependencies necessary to run all examples, run the following command:
71+
72+
.. code-block:: bash
73+
74+
pip install squlearn[examples]
75+
76+
And to install sQUlearn with the dependencies necessary to build the documentation,
77+
run the following command:
78+
79+
.. code-block:: bash
80+
81+
pip install squlearn[docs]

docs/user_guide/encoding_circuits.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ sQUlearn features a fully automated pruning algorithm which can be used by calli
152152
from squlearn.encoding_circuit import LayeredEncodingCircuit, automated_pruning
153153
from squlearn.util import Executor
154154
encoding_circuit = LayeredEncodingCircuit.from_string("Rz(p)-Ry(p)-Z-Ry(p)-Rz(p)", num_qubits=2, num_features=0)
155-
pruned_encoding_circuit = automated_pruning(encoding_circuit, Executor("statevector_simulator"))
155+
pruned_encoding_circuit = automated_pruning(encoding_circuit, Executor())
156156
pruned_encoding_circuit.draw(output="mpl")
157157

158158

0 commit comments

Comments
 (0)