Skip to content

Commit b4530ea

Browse files
doichanjt-imamichihhorii
authored
Release 0.15.1 (#2225)
* Add `open_pulse` entry to `AerBackendConfiguration` (#2214) * add open_pulse entry to AerBackendConfiguration * add test * Fix tests Aer 0.15 in the latest environments (#2223) * qiskit 1.0.0rc1 -> 1.3.0b1 * test * test * fix tutorial * add release note * change version number * Revert NoiseModel.from_dict (#2222) * Truncate save_expval (#2216) * truncate save_expval * fix truncation * fix truncation * add num_original_qubits to aer_circuit to get num_qubits without ancilla qubits * Fix adding qubitset * add test case, release note and fix docs * fix doc * fix doc * fix doc * fix doc * fix doc * fix doc * fix doc * fix doc * change truncation strategy * format * remove print * no truncation when circuit is empty * Update VERSION.txt revert to 0.15.0 --------- Co-authored-by: Hiroshi Horii <[email protected]> --------- Co-authored-by: Takashi Imamichi <[email protected]> Co-authored-by: Hiroshi Horii <[email protected]>
1 parent 11a89c4 commit b4530ea

16 files changed

+314
-41
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,24 @@ jobs:
3939
matrix:
4040
os: [ubuntu-latest]
4141
steps:
42-
- uses: actions/checkout@v3
43-
- uses: actions/setup-python@v4
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-python@v5
4444
name: Install Python
4545
with:
4646
python-version: '3.10'
4747
- uses: actions-rs/toolchain@v1
4848
with:
4949
toolchain: stable
5050
- name: Set up QEMU
51-
uses: docker/setup-qemu-action@v1
51+
uses: docker/setup-qemu-action@v3
5252
with:
5353
platforms: all
54-
- name: Install cibuildwheel
55-
run: |
56-
python -m pip install cibuildwheel==2.17.0
5754
- name: Build wheels
58-
run: |
59-
python -m cibuildwheel --output-dir wheelhouse
55+
uses: pypa/[email protected]
6056
env:
61-
CIBW_BEFORE_ALL_LINUX: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y https://dl.fedoraproject.org/pub/epel/7/aarch64/Packages/e/epel-release-7-12.noarch.rpm && yum install -y openblas-devel"
57+
CIBW_BEFORE_ALL_LINUX: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y https://dl.fedoraproject.org/pub/archive/epel/7/aarch64/Packages/e/epel-release-7-12.noarch.rpm && yum install -y openblas-devel"
6258
CIBW_ARCHS_LINUX: aarch64
63-
CIBW_TEST_SKIP: "cp38* cp39* cp310* cp311*"
59+
CIBW_TEST_SKIP: "cp*"
6460
- uses: actions/upload-artifact@v4
6561
with:
6662
path: ./wheelhouse/*.whl
@@ -226,15 +222,15 @@ jobs:
226222
with:
227223
toolchain: stable
228224
- name: Set up QEMU
229-
uses: docker/setup-qemu-action@v1
225+
uses: docker/setup-qemu-action@v3
230226
with:
231227
platforms: all
232228
- name: Build wheels
233-
uses: pypa/cibuildwheel@v2.16.2
229+
uses: pypa/cibuildwheel@v2.19.2
234230
env:
235231
CIBW_ARCHS_LINUX: s390x
236232
CIBW_TEST_SKIP: "cp*"
237-
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y epel-release && yum install -y openblas-devel"
233+
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y https://dl.fedoraproject.org/pub/epel/8/Everything/s390x/Packages/e/epel-release-8-21.el8.noarch.rpm && yum install -y openblas-devel"
238234
- uses: actions/upload-artifact@v4
239235
with:
240236
path: ./wheelhouse/*.whl
@@ -262,15 +258,15 @@ jobs:
262258
with:
263259
toolchain: stable
264260
- name: Set up QEMU
265-
uses: docker/setup-qemu-action@v1
261+
uses: docker/setup-qemu-action@v3
266262
with:
267263
platforms: all
268264
- name: Build wheels
269-
uses: pypa/cibuildwheel@v2.16.2
265+
uses: pypa/cibuildwheel@v2.19.2
270266
env:
267+
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y https://dl.fedoraproject.org/pub/archive/epel/7/ppc64le/Packages/e/epel-release-7-14.noarch.rpm && yum install -y openblas-devel"
271268
CIBW_ARCHS_LINUX: ppc64le
272269
CIBW_TEST_SKIP: "cp*"
273-
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y epel-release && yum install -y openblas-devel"
274270
- uses: actions/upload-artifact@v4
275271
with:
276272
path: ./wheelhouse/*.whl

.github/workflows/docs.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 60
1414
strategy:
1515
matrix:
16-
python-version: ['3.8']
16+
python-version: ['3.9']
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
@@ -50,7 +50,7 @@ jobs:
5050
needs: [docs]
5151
strategy:
5252
matrix:
53-
python-version: ['3.8']
53+
python-version: ['3.9']
5454
steps:
5555
- uses: actions/checkout@v4
5656
- name: Set up Python ${{ matrix.python-version }}
@@ -74,15 +74,14 @@ jobs:
7474
pip install -U -r requirements-dev.txt -c constraints.txt
7575
pip install -c constraints.txt git+https://github.com/Qiskit/qiskit
7676
pip install -c constraints.txt .
77-
pip install -U "qiskit-ibmq-provider" "z3-solver" "qiskit-ignis" "qiskit-aqua" "pyscf<1.7.4" "matplotlib>=3.3.0" jupyter pylatexenc nbsphinx cvxpy qiskit-sphinx-theme -c constraints.txt
7877
sudo apt install -y graphviz pandoc libopenblas-dev
7978
pip check
8079
shell: bash
8180
- name: Run Tutorials
8281
run: |
8382
set -e
8483
cd qiskit-tutorials
85-
rm -rf tutorials/chemistry tutorials/circuits tutorials/circuits_advanced tutorials/finance tutorials/optimization tutorials/algorithms tutorials/operators tutorials/noise tutorials/machine_learning
84+
rm -rf tutorials/circuits tutorials/circuits_advanced tutorials/algorithms tutorials/operators
8685
sphinx-build -b html . _build/html
8786
- uses: actions/upload-artifact@v4
8887
with:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
qiskit-extra: [""]
9898
include:
9999
- python-version: "3.10"
100-
qiskit-extra: "'qiskit>=1.0.0rc1'"
100+
qiskit-extra: "'qiskit>=1.3.0b1'"
101101

102102
env:
103103
AER_THRUST_BACKEND: OMP

qiskit_aer/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.15.0
1+
0.15.1

qiskit_aer/backends/backendconfiguration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def __init__(
220220
self.local = True
221221
self.simulator = True
222222
self.conditional = True
223+
self.open_pulse = False
223224
self.memory = True
224225
self.max_shots = max_shots
225226
self.coupling_map = coupling_map

qiskit_aer/noise/noise_model.py

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
import numpy as np
2222

23-
from qiskit.circuit import Instruction, Delay
23+
from qiskit.circuit import QuantumCircuit, Instruction, Delay, Reset
24+
from qiskit.circuit.library.generalized_gates import PauliGate, UnitaryGate
2425
from qiskit.providers import QubitProperties
2526
from qiskit.providers.exceptions import BackendPropertyError
2627
from qiskit.providers.models.backendproperties import BackendProperties
@@ -959,6 +960,105 @@ def to_dict(self, serializable=False):
959960

960961
return ret
961962

963+
@staticmethod
964+
def from_dict(noise_dict):
965+
"""
966+
Load NoiseModel from a dictionary.
967+
Args:
968+
noise_dict (dict): A serialized noise model.
969+
Returns:
970+
NoiseModel: the noise model.
971+
Raises:
972+
NoiseError: if dict cannot be converted to NoiseModel.
973+
"""
974+
warn(
975+
"from_dict has been deprecated as of qiskit-aer 0.15.0"
976+
" and will be removed no earlier than 3 months from that release date.",
977+
DeprecationWarning,
978+
stacklevel=2,
979+
)
980+
981+
def inst_dic_list_to_circuit(dic_list):
982+
num_qubits = max(max(dic["qubits"]) for dic in dic_list) + 1
983+
circ = QuantumCircuit(num_qubits)
984+
for dic in dic_list:
985+
if dic["name"] == "reset":
986+
circ.append(Reset(), qargs=dic["qubits"])
987+
elif dic["name"] == "kraus":
988+
circ.append(
989+
Instruction(
990+
name="kraus",
991+
num_qubits=len(dic["qubits"]),
992+
num_clbits=0,
993+
params=dic["params"],
994+
),
995+
qargs=dic["qubits"],
996+
)
997+
elif dic["name"] == "unitary":
998+
circ.append(UnitaryGate(data=dic["params"][0]), qargs=dic["qubits"])
999+
elif dic["name"] == "pauli":
1000+
circ.append(PauliGate(dic["params"][0]), qargs=dic["qubits"])
1001+
else:
1002+
with catch_warnings():
1003+
filterwarnings(
1004+
"ignore",
1005+
category=DeprecationWarning,
1006+
module="qiskit_aer.noise.errors.errorutils",
1007+
)
1008+
circ.append(
1009+
UnitaryGate(
1010+
label=dic["name"], data=_standard_gate_unitary(dic["name"])
1011+
),
1012+
qargs=dic["qubits"],
1013+
)
1014+
return circ
1015+
1016+
# Return noise model
1017+
noise_model = NoiseModel()
1018+
1019+
# Get error terms
1020+
errors = noise_dict.get("errors", [])
1021+
1022+
for error in errors:
1023+
error_type = error["type"]
1024+
1025+
# Add QuantumError
1026+
if error_type == "qerror":
1027+
circuits = [inst_dic_list_to_circuit(dics) for dics in error["instructions"]]
1028+
noise_ops = tuple(zip(circuits, error["probabilities"]))
1029+
qerror = QuantumError(noise_ops)
1030+
qerror._id = error.get("id", None) or qerror.id
1031+
instruction_names = error["operations"]
1032+
all_gate_qubits = error.get("gate_qubits", None)
1033+
if all_gate_qubits is not None:
1034+
for gate_qubits in all_gate_qubits:
1035+
# Add local quantum error
1036+
noise_model.add_quantum_error(
1037+
qerror, instruction_names, gate_qubits, warnings=False
1038+
)
1039+
else:
1040+
# Add all-qubit quantum error
1041+
noise_model.add_all_qubit_quantum_error(
1042+
qerror, instruction_names, warnings=False
1043+
)
1044+
1045+
# Add ReadoutError
1046+
elif error_type == "roerror":
1047+
probabilities = error["probabilities"]
1048+
all_gate_qubits = error.get("gate_qubits", None)
1049+
roerror = ReadoutError(probabilities)
1050+
# Add local readout error
1051+
if all_gate_qubits is not None:
1052+
for gate_qubits in all_gate_qubits:
1053+
noise_model.add_readout_error(roerror, gate_qubits, warnings=False)
1054+
# Add all-qubit readout error
1055+
else:
1056+
noise_model.add_all_qubit_readout_error(roerror, warnings=False)
1057+
# Invalid error type
1058+
else:
1059+
raise NoiseError("Invalid error type: {}".format(error_type))
1060+
return noise_model
1061+
9621062
def _instruction_names_labels(self, instructions):
9631063
"""Return two lists of instruction name strings and label strings."""
9641064
if not isinstance(instructions, (list, tuple)):

qiskit_aer/noise/passes/local_noise_pass.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ def run(self, dag: DAGCircuit) -> DAGCircuit:
144144
if isinstance(new_op, QuantumCircuit):
145145
# If the new op is a quantum circuit, compose its DAG with the new dag
146146
# so that it is unrolled rather than added as an opaque instruction
147-
new_dag.compose(circuit_to_dag(new_op), qubits=node.qargs) # never touch clbits
147+
new_dag.compose(
148+
circuit_to_dag(new_op), qubits=list(node.qargs)
149+
) # never touch clbits
148150
else:
149151
# Otherwise append the instruction returned by the function
150152
new_dag.apply_operation_back(new_op, qargs=node.qargs) # never touch cargs
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
SIGSEGV raised when the circuits with unsupported gates is
5+
passed to MPS simulator, because of `std::set.find()` in
6+
size estimator for MPS.
7+
This fix avoids SIGSEGV if unsupported gates is passed.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed tutorial build failure of Python version and unused tutorials.
5+
Upgraded test for Qiskit 1.0.0rc1 to 1.3.0b1 this will need protection rules
6+
for Aer repository. Also fixed noise/passes/local_noise_pass.py needed
7+
conversion from tuple to list
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
deprecations:
3+
- |
4+
Reverting NoiseModel.from_dict temporary to extend deprecation period
5+
for qiskit-ibm-runtime, but we will remove again in the future release

0 commit comments

Comments
 (0)