Skip to content

Commit b22c918

Browse files
enable workflow
1 parent 3eca659 commit b22c918

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
name: test
77
strategy:
88
matrix:
9-
os: [ubuntu-20.04] # macos-latest disabled as one test randomly fails
9+
os: [ubuntu-22.04] # macos-latest disabled as one test randomly fails
1010
python-version: ["3.10"]
1111
fail-fast: false
1212
steps:

.github/workflows/nightly_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- cron: "0 12 * * *"
88
jobs:
99
tests:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
name: test
1212
strategy:
1313
fail-fast: false

tensorcircuit/basecircuit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,10 @@ def readouterror_bs(
796796
"""
797797
# if isinstance(readout_error, tuple):
798798
# readout_error = list[readout_error] # type: ignore
799-
800-
nqubit = len(readout_error) # type: ignore
799+
try:
800+
nqubit = int(readout_error.shape[0]) # type: ignore
801+
except AttributeError:
802+
nqubit = len(readout_error) # type: ignore
801803
readoutlist = []
802804
for i in range(nqubit):
803805
readoutlist.append(

tensorcircuit/results/readout_mitigation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,10 @@ def _matvec_solver( # type: ignore
723723
cals = self._form_cals(qubits)
724724
M = M3MatVec(dict(counts), cals, distance)
725725
L = spla.LinearOperator(
726-
(M.num_elems, M.num_elems), matvec=M.matvec, rmatvec=M.rmatvec
726+
(M.num_elems, M.num_elems),
727+
matvec=M.matvec,
728+
rmatvec=M.rmatvec,
729+
dtype=np.float64,
727730
)
728731
diags = M.get_diagonal()
729732

tensorcircuit/translation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646

4747
def get_qiskit_qasm(qc: Any) -> str:
48-
4948
try:
5049
qasm_str = qc.qasm() # type: ignore
5150
except AttributeError: # qiskit 1.0

tests/test_interfaces.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ def g(a, b, c):
431431

432432

433433
def test_jax_interface_basic(tfb):
434-
435434
def f(params):
436435
c = tc.Circuit(1)
437436
c.rx(0, theta=params[0])
@@ -453,7 +452,6 @@ def f(params):
453452

454453

455454
def test_jax_interface_multiple_inputs(tfb):
456-
457455
def f(params1, params2):
458456
c = tc.Circuit(2)
459457
c.rx(0, theta=params1[0])
@@ -481,7 +479,6 @@ def f(params1, params2):
481479
reason="might fail when testing with other function",
482480
)
483481
def test_jax_interface_jit_dlpack(tfb):
484-
485482
def f(params):
486483
c = tc.Circuit(2)
487484
c.rx(range(2), theta=params)
@@ -502,7 +499,6 @@ def f(params):
502499

503500

504501
def test_jax_interface_pure_callback(tfb):
505-
506502
def f(params):
507503
# Use TF operation to test pure_callback
508504
return tf.square(params)
@@ -531,7 +527,6 @@ def f_jax2(params):
531527

532528

533529
def test_jax_interface_multiple_outputs(tfb):
534-
535530
def f(params):
536531
# Use TF operation to test pure_callback
537532
return tf.square(params), params

tests/test_results.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def test_marginal_count():
1616

1717

1818
def test_merge_count():
19-
2019
c1 = {"00": 10, "01": 20, "11": 30}
2120
c2 = {"00": 5, "10": 15, "11": 25}
2221
c3 = {"01": 10, "10": 20}

0 commit comments

Comments
 (0)