Skip to content

Commit

Permalink
Merge branch 'main' into ikkoham-codeowner
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 20, 2022
2 parents cec2d38 + d662fbb commit b580ec2
Show file tree
Hide file tree
Showing 20 changed files with 235 additions and 56 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ jobs:
platforms: all
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.0.1 twine
python -m pip install cibuildwheel==2.2.2 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp27-* cp34-* cp35-* pp*
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v2
with:
Expand Down
28 changes: 12 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ stages:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
variables:
python.version: '3.7'
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip
pip install cibuildwheel==1.11.0
pip install cibuildwheel==2.2.2
pip install -U twine
cibuildwheel --output-dir wheelhouse .
- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -71,16 +68,13 @@ stages:
pool: {vmImage: 'macOS-10.15'}
variables:
python.version: '3.7'
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip
pip install cibuildwheel==1.11.0
pip install cibuildwheel==2.2.2
pip install -U twine
cibuildwheel --output-dir wheelhouse .
- task: PublishBuildArtifacts@1
Expand All @@ -95,17 +89,14 @@ stages:
pool: {vmImage: 'macOS-10.15'}
variables:
python.version: '3.7'
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* pp*
CIBW_ARCHS_MACOS: universal2
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip
pip install cibuildwheel==1.11.0
pip install cibuildwheel==2.2.2
pip install -U twine
cibuildwheel --output-dir wheelhouse .
- task: PublishBuildArtifacts@1
Expand All @@ -119,21 +110,20 @@ stages:
pool: {vmImage: 'vs2017-win2016'}
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
variables:
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}\examples\python\stochastic_swap.py
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.9', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.9', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.10', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.10', architecture: x64}}
- bash: |
set -e
python -m pip install --upgrade pip
pip install cibuildwheel==1.11.0
pip install cibuildwheel==2.2.2
pip install -U twine
cibuildwheel --output-dir wheelhouse
- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -508,6 +498,8 @@ stages:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
variables:
QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand Down Expand Up @@ -587,6 +579,8 @@ stages:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
variables:
QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
Expand Down Expand Up @@ -669,6 +663,8 @@ stages:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
variables:
QISKIT_SUPPRESS_PACKAGING_WARNINGS: Y
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ibmq/hello_quantum.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
print("Running on current least busy device: ", least_busy_device)

# running the job
job_exp = execute(qc, least_busy_device, shots=1024, max_credits=10)
job_exp = execute(qc, least_busy_device, shots=1024)
result_exp = job_exp.result()

# Show the results
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ibmq/using_qiskit_terra_level_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
print("Running on current least busy device: ", least_busy_device)

# running the job
job_exp = execute([qc1, qc2], backend=least_busy_device, shots=1024, max_credits=10)
job_exp = execute([qc1, qc2], backend=least_busy_device, shots=1024)

job_monitor(job_exp)
exp_result = job_exp.result()
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ requires = ["Cython>=0.27.1", "setuptools", "wheel"]
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39']

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2010"
manylinux-i686-image = "manylinux2010"
skip = "pp* cp36-*"
test-command = "python {project}/examples/python/stochastic_swap.py"
14 changes: 12 additions & 2 deletions qiskit/assembler/run_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
"""Models for RunConfig and its related components."""

from types import SimpleNamespace
import warnings


class RunConfig(SimpleNamespace):
"""Class for Run Configuration.
Attributes:
shots (int): the number of shots
max_credits (int): the max_credits to use on the IBM Q public devices
max_credits (int): DEPRECATED This parameter is deprecated as of
Qiskit Terra 0.20.0, and will be removed in a future release. This parameter has
no effect on modern IBM Quantum systems, and no alternative is necessary.
seed_simulator (int): the seed to use in the simulator
memory (bool): whether to request memory from backend (per-shot
readouts)
Expand All @@ -40,7 +43,7 @@ def __init__(
Args:
shots (int): the number of shots
max_credits (int): the max_credits to use on the IBM Q public
max_credits (int): DEPRECATED the max_credits to use on the IBM Q public
devices
seed_simulator (int): the seed to use in the simulator
memory (bool): whether to request memory from backend
Expand All @@ -52,6 +55,13 @@ def __init__(
self.shots = shots
if max_credits is not None:
self.max_credits = max_credits
warnings.warn(
"The `max_credits` parameter is deprecated as of Qiskit Terra 0.20.0, "
"and will be removed in a future release. This parameter has no effect on "
"modern IBM Quantum systems, and no alternative is necessary.",
DeprecationWarning,
stacklevel=2,
)
if seed_simulator is not None:
self.seed_simulator = seed_simulator
if memory is not None:
Expand Down
13 changes: 12 additions & 1 deletion qiskit/compiler/assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def assemble(
memory: If ``True``, per-shot measurement bitstrings are returned as well
(provided the backend supports it). For OpenPulse jobs, only
measurement level 2 supports this option.
max_credits: Maximum credits to spend on job. Default: 10
max_credits: DEPRECATED This parameter is deprecated as of
Qiskit Terra 0.20.0, and will be removed in a future release. This parameter has
no effect on modern IBM Quantum systems, and no alternative is necessary.
seed_simulator: Random seed to control sampling, for when backend is a simulator
qubit_lo_freq: List of job level qubit drive LO frequencies in Hz. Overridden by
``schedule_los`` if specified. Must have length ``n_qubits.``
Expand Down Expand Up @@ -155,6 +157,15 @@ def assemble(
Raises:
QiskitError: if the input cannot be interpreted as either circuits or schedules
"""
if max_credits is not None:
max_credits = None
warnings.warn(
"The `max_credits` parameter is deprecated as of Qiskit Terra 0.20.0, "
"and will be removed in a future release. This parameter has no effect on "
"modern IBM Quantum systems, and no alternative is necessary.",
DeprecationWarning,
stacklevel=2,
)
start_time = time()
experiments = experiments if isinstance(experiments, list) else [experiments]
pulse_qobj = any(isinstance(exp, (ScheduleBlock, Schedule, Instruction)) for exp in experiments)
Expand Down
16 changes: 12 additions & 4 deletions qiskit/execute_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""
import logging
from time import time
import warnings
from qiskit.compiler import transpile, assemble, schedule
from qiskit.providers import BaseBackend
from qiskit.providers.backend import Backend
Expand Down Expand Up @@ -166,7 +167,9 @@ def execute(
(provided the backend supports it). For OpenPulse jobs, only
measurement level 2 supports this option. Default: False
max_credits (int): Maximum credits to spend on job. Default: 10
max_credits (int): DEPRECATED This parameter is deprecated as of
Qiskit Terra 0.20.0, and will be removed in a future release. This parameter has
no effect on modern IBM Quantum systems, and no alternative is necessary.
seed_simulator (int): Random seed to control sampling, for when backend is a simulator
Expand Down Expand Up @@ -310,15 +313,21 @@ def execute(
meas_map=meas_map,
method=scheduling_method,
)
if max_credits is not None:
warnings.warn(
"The `max_credits` parameter is deprecated as of Qiskit Terra 0.20.0, "
"and will be removed in a future release. This parameter has no effect on "
"modern IBM Quantum systems, and no alternative is necessary.",
DeprecationWarning,
stacklevel=2,
)

if isinstance(backend, BaseBackend):
# assembling the circuits into a qobj to be run on the backend
if shots is None:
shots = 1024
if memory is None:
memory = False
if max_credits is None:
max_credits = 10
if meas_level is None:
meas_level = MeasLevel.CLASSIFIED
if meas_return is None:
Expand All @@ -332,7 +341,6 @@ def execute(
qobj_header=qobj_header,
shots=shots,
memory=memory,
max_credits=max_credits,
seed_simulator=seed_simulator,
qubit_lo_freq=default_qubit_los,
meas_lo_freq=default_meas_los,
Expand Down
14 changes: 11 additions & 3 deletions qiskit/qobj/pulse_qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import copy
import pprint
from typing import Union, List

import warnings
import numpy

from qiskit.qobj.common import QobjDictField
from qiskit.qobj.common import QobjHeader
from qiskit.qobj.common import QobjExperimentHeader
Expand Down Expand Up @@ -307,7 +306,9 @@ def __init__(
supplied by the backend (``backend.configuration().rep_delay_range``). Default is
``backend.configuration().default_rep_delay``.
shots (int): The number of shots
max_credits (int): the max_credits to use on the IBMQ public devices.
max_credits (int): DEPRECATED This parameter is deprecated as of
Qiskit Terra 0.20.0, and will be removed in a future release. This parameter has
no effect on modern IBM Quantum systems, and no alternative is necessary.
seed_simulator (int): the seed to use in the simulator
memory_slots (list): The number of memory slots on the device
kwargs: Additional free form key value fields to add to the
Expand All @@ -329,6 +330,13 @@ def __init__(

if max_credits is not None:
self.max_credits = int(max_credits)
warnings.warn(
"The `max_credits` parameter is deprecated as of Qiskit Terra 0.20.0, "
"and will be removed in a future release. This parameter has no effect on "
"modern IBM Quantum systems, and no alternative is necessary.",
DeprecationWarning,
stacklevel=2,
)

if seed_simulator is not None:
self.seed_simulator = int(seed_simulator)
Expand Down
14 changes: 11 additions & 3 deletions qiskit/qobj/qasm_qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import copy
import pprint
from types import SimpleNamespace

import warnings
from qiskit.circuit.parameterexpression import ParameterExpression
from qiskit.qobj.pulse_qobj import PulseQobjInstruction, PulseLibraryItem
from qiskit.qobj.common import QobjDictField, QobjHeader
Expand Down Expand Up @@ -301,7 +301,9 @@ def __init__(
Args:
shots (int): the number of shots.
max_credits (int): the max_credits to use on the IBMQ public devices.
max_credits (int): DEPRECATED This parameter is deprecated as of
Qiskit Terra 0.20.0, and will be removed in a future release. This parameter has
no effect on modern IBM Quantum systems, and no alternative is necessary.
seed_simulator (int): the seed to use in the simulator
memory (bool): whether to request memory from backend (per-shot readouts)
parameter_binds (list[dict]): List of parameter bindings
Expand All @@ -326,7 +328,13 @@ def __init__(

if max_credits is not None:
self.max_credits = int(max_credits)

warnings.warn(
"The `max_credits` parameter is deprecated as of Qiskit Terra 0.20.0, "
"and will be removed in a future release. This parameter has no effect on "
"modern IBM Quantum systems, and no alternative is necessary.",
DeprecationWarning,
stacklevel=2,
)
if seed_simulator is not None:
self.seed_simulator = int(seed_simulator)

Expand Down
3 changes: 3 additions & 0 deletions qiskit/test/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def setUpClass(cls):
r"The pauli_basis function with PauliTable.*",
# TODO: remove the following ignore after seaborn 0.12.0 releases
r"distutils Version classes are deprecated. Use packaging\.version",
# Internal deprecation warning emitted by jupyter client when
# calling nbconvert in python 3.10
r"There is no current event loop",
]
for msg in allow_DeprecationWarning_message:
warnings.filterwarnings("default", category=DeprecationWarning, message=msg)
Expand Down
2 changes: 1 addition & 1 deletion qiskit/test/mock/fake_qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FakeQobj(QasmQobj):

def __init__(self):
qobj_id = "test_id"
config = QasmQobjConfig(shots=1024, memory_slots=1, max_credits=100)
config = QasmQobjConfig(shots=1024, memory_slots=1)
header = QobjHeader(backend_name=FakeQasmSimulator().name())
experiments = [
QasmQobjExperiment(
Expand Down
Loading

0 comments on commit b580ec2

Please sign in to comment.