Skip to content

Commit 57f1917

Browse files
authored
Merge pull request #299 from mit-han-lab/upgrade-qiskit1
Upgrade to qiskit-1.4
2 parents 00039cc + c7b09a8 commit 57f1917

Some content is hidden

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

43 files changed

+49888
-1068
lines changed

.github/workflows/functional_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1818

1919
steps:
2020
- uses: actions/checkout@v3

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,15 @@ es_runs/
336336
.vscode-upload.json
337337

338338
mnist_data/
339+
340+
configs.yml
341+
debug_qiskit.txt
342+
fix_note.txt
343+
h2_new.txt
344+
max-acc-valid.pt
345+
model.pt
346+
.cursor/rules/*.mdc
347+
348+
.cursorignore
349+
.cursor/
350+
.github/copilot-instructions.md

examples/QuantumNAS/quantumnas.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,7 +4056,8 @@
40564056
"toc_visible": true
40574057
},
40584058
"kernelspec": {
4059-
"display_name": "Python 3",
4059+
"display_name": "torchquantum",
4060+
"language": "python",
40604061
"name": "python3"
40614062
},
40624063
"language_info": {
@@ -4069,7 +4070,7 @@
40694070
"name": "python",
40704071
"nbconvert_exporter": "python",
40714072
"pygments_lexer": "ipython3",
4072-
"version": "3.8.16"
4073+
"version": "3.9.20"
40734074
},
40744075
"widgets": {
40754076
"application/vnd.jupyter.widget-state+json": {

examples/gradient_pruning/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from torchpack.utils.logging import logger
3838
from torchpack.utils.typing import Trainer
3939
from torchpack import distributed as dist
40-
from torchquantum.super_utils import get_named_sample_arch
40+
from torchquantum.algorithm.quantumnas.super_utils import get_named_sample_arch
4141
from torchquantum.util import legalize_unitary
4242

4343

examples/regression/new_run_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646

4747

4848
def gen_data(L, N):
49-
omega_0 = np.zeros([2**L], dtype="complex_")
49+
omega_0 = np.zeros([2**L], dtype=complex)
5050
omega_0[0] = 1 + 0j
5151

52-
omega_1 = np.zeros([2**L], dtype="complex_")
52+
omega_1 = np.zeros([2**L], dtype=complex)
5353
omega_1[-1] = 1 + 0j
5454

55-
states = np.zeros([N, 2**L], dtype="complex_")
55+
states = np.zeros([N, 2**L], dtype=complex)
5656

5757
thetas = 2 * np.pi * np.random.rand(N)
5858
phis = 2 * np.pi * np.random.rand(N)

examples/regression/run_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040

4141

4242
def gen_data(L, N):
43-
omega_0 = np.zeros([2**L], dtype="complex_")
43+
omega_0 = np.zeros([2**L], dtype=complex)
4444
omega_0[0] = 1 + 0j
4545

46-
omega_1 = np.zeros([2**L], dtype="complex_")
46+
omega_1 = np.zeros([2**L], dtype=complex)
4747
omega_1[-1] = 1 + 0j
4848

49-
states = np.zeros([N, 2**L], dtype="complex_")
49+
states = np.zeros([N, 2**L], dtype=complex)
5050

5151
thetas = 2 * np.pi * np.random.rand(N)
5252
phis = 2 * np.pi * np.random.rand(N)

examples/save_load_example/save_load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def save_load2():
119119

120120
torch.save(model, "model_whole.pt")
121121

122-
model2 = torch.load("model_whole.pt")
122+
model2 = torch.load("model_whole.pt", weights_only=False)
123123
y2 = model2(x)
124124
print(y2)
125125
assert torch.equal(y, y2)

requirement_update.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
dill
3+
matplotlib
4+
nbsphinx
5+
numpy
6+
7+
opt_einsum
8+
pathos
9+
pylatexenc
10+
pyscf
11+
qiskit
12+
recommonmark
13+
qiskit_ibm_runtime
14+
qiskit-aer
15+
16+
scipy
17+
setuptools
18+
tensorflow
19+
torch
20+
torchdiffeq
21+
torchpack
22+
torchquantum
23+
torchvision
24+
tqdm

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ opt_einsum
88
pathos>=0.2.7
99
pylatexenc>=2.10
1010
pyscf>=2.0.1
11-
qiskit>=0.39.0,<1.0.0
11+
qiskit==1.4.3
1212
recommonmark
13-
qiskit_ibm_runtime==0.20.0
14-
qiskit-aer==0.13.3
13+
qiskit_ibm_runtime
14+
qiskit-aer
1515

1616
scipy>=1.5.2
1717
setuptools>=52.0.0
@@ -21,4 +21,4 @@ torchdiffeq>=0.2.3
2121
torchpack>=0.3.0
2222
torchquantum>=0.1
2323
torchvision>=0.9.0.dev20210130
24-
tqdm>=4.56.0
24+
tqdm>=4.56.0

sec1_basic.ipynb

Lines changed: 30302 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)