Skip to content

Commit

Permalink
Merge pull request #176 from CQCL/release/0.44.0
Browse files Browse the repository at this point in the history
Release/0.44.0
  • Loading branch information
cqc-alec authored Sep 5, 2023
2 parents c3e3339 + f14c000 commit ee1e3b3
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 99 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
needs: publish_to_pypi
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up Python 3.10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: build docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion _metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__extension_version__ = "0.43.0"
__extension_version__ = "0.44.0"
__extension_name__ = "pytket-qiskit"
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
~~~~~~~~~

0.44.0 (September 2023)
-----------------------

* Fix to add include Measure, Reset and Conditional operations to the supported operations of :py:class:`AerStateBackend`.
* Update qiskit-ibm-runtime version to 0.12.0.
* Update qiskit-ibm-provider version to 0.7.0.
* Update pytket version requirement to 1.19.

0.43.0 (August 2023)
--------------------

Expand Down
34 changes: 20 additions & 14 deletions pytket/extensions/qiskit/backends/aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def _tket_gate_set_from_qiskit_backend(
gate_set.add(OpType.Unitary1qBox)
gate_set.add(OpType.Unitary2qBox)
gate_set.add(OpType.Unitary3qBox)

if qiskit_backend.name() != "aer_simulator_unitary":
gate_set.add(OpType.Reset)
gate_set.add(OpType.Measure)
gate_set.add(OpType.Conditional)

# special case mapping TK1 to U
gate_set.add(OpType.TK1)
return gate_set
Expand Down Expand Up @@ -138,17 +144,17 @@ def _arch_dependent_default_compilation_pass(
if placement_options is not None:
noise_aware_placement = NoiseAwarePlacement(
arch,
self._backend_info.averaged_node_gate_errors,
self._backend_info.averaged_edge_gate_errors,
self._backend_info.averaged_readout_errors,
self._backend_info.averaged_node_gate_errors, # type: ignore
self._backend_info.averaged_edge_gate_errors, # type: ignore
self._backend_info.averaged_readout_errors, # type: ignore
**placement_options,
)
else:
noise_aware_placement = NoiseAwarePlacement(
arch,
self._backend_info.averaged_node_gate_errors,
self._backend_info.averaged_edge_gate_errors,
self._backend_info.averaged_readout_errors,
self._backend_info.averaged_node_gate_errors, # type: ignore
self._backend_info.averaged_edge_gate_errors, # type: ignore
self._backend_info.averaged_readout_errors, # type: ignore
)

arch_specific_passes = [
Expand Down Expand Up @@ -207,11 +213,11 @@ def default_compilation_pass(
arch = self._backend_info.architecture
if (
self._has_arch
and arch.coupling
and arch.coupling # type: ignore
and self._backend_info.get_misc("characterisation")
):
return self._arch_dependent_default_compilation_pass(
arch, optimisation_level, placement_options=placement_options
arch, optimisation_level, placement_options=placement_options # type: ignore
)

return self._arch_independent_default_compilation_pass(optimisation_level)
Expand Down Expand Up @@ -394,7 +400,7 @@ class NoiseModelCharacterisation:
edge_errors: Optional[Dict] = None
readout_errors: Optional[Dict] = None
averaged_node_errors: Optional[Dict[Node, float]] = None
averaged_edge_errors: Optional[Dict[Node, float]] = None
averaged_edge_errors: Optional[Dict[Tuple[Node, Node], float]] = None
averaged_readout_errors: Optional[Dict[Node, float]] = None
generic_q_errors: Optional[Dict] = None

Expand Down Expand Up @@ -460,8 +466,8 @@ def __init__(
characterisation = _get_characterisation_of_noise_model(
self._noise_model, gate_set
)
self._has_arch = (
characterisation.architecture and characterisation.architecture.nodes
self._has_arch = bool(characterisation.architecture) and bool(
characterisation.architecture.nodes
)

self._backend_info = BackendInfo(
Expand Down Expand Up @@ -523,12 +529,12 @@ def __init__(
version=__extension_version__,
architecture=FullyConnected(n_qubits),
gate_set=_tket_gate_set_from_qiskit_backend(self._qiskit_backend),
supports_midcircuit_measurement=True, # is this correct?
supports_midcircuit_measurement=True,
supports_reset=True,
supports_fast_feedforward=True,
misc={"characterisation": None},
)
self._required_predicates = [
NoClassicalControlPredicate(),
NoFastFeedforwardPredicate(),
GateSetPredicate(self._backend_info.gate_set),
]

Expand Down
4 changes: 2 additions & 2 deletions pytket/extensions/qiskit/backends/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def set_ibmq_config(

config = QiskitConfig.from_default_config_file()
if instance is not None:
config.instance = instance
config.instance = instance # type: ignore
if ibmq_api_token is not None:
config.ibmq_api_token = ibmq_api_token
config.ibmq_api_token = ibmq_api_token # type: ignore
config.update_default_config_file()
16 changes: 8 additions & 8 deletions pytket/extensions/qiskit/backends/ibm.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __init__(
super().__init__()
self._pytket_config = QiskitConfig.from_default_config_file()
self._provider = (
self._get_provider(instance=instance, qiskit_config=self._pytket_config)
self._get_provider(instance=instance, qiskit_config=self._pytket_config) # type: ignore
if provider is None
else provider
)
Expand Down Expand Up @@ -287,7 +287,7 @@ def _get_backend_info(cls, backend: "_QiskIBMBackend") -> BackendInfo:
all_edge_gate_errors=characterisation["EdgeErrors"],
all_readout_errors=characterisation["ReadoutErrors"],
averaged_node_gate_errors=averaged_errors["node_errors"],
averaged_edge_gate_errors=averaged_errors["edge_errors"],
averaged_edge_gate_errors=averaged_errors["edge_errors"], # type: ignore
averaged_readout_errors=averaged_errors["readout_errors"],
misc={"characterisation": filtered_characterisation},
)
Expand Down Expand Up @@ -393,17 +393,17 @@ def default_compilation_pass(
if placement_options is not None:
noise_aware_placement = NoiseAwarePlacement(
arch,
self._backend_info.averaged_node_gate_errors,
self._backend_info.averaged_edge_gate_errors,
self._backend_info.averaged_readout_errors,
self._backend_info.averaged_node_gate_errors, # type: ignore
self._backend_info.averaged_edge_gate_errors, # type: ignore
self._backend_info.averaged_readout_errors, # type: ignore
**placement_options,
)
else:
noise_aware_placement = NoiseAwarePlacement(
arch,
self._backend_info.averaged_node_gate_errors,
self._backend_info.averaged_edge_gate_errors,
self._backend_info.averaged_readout_errors,
self._backend_info.averaged_node_gate_errors, # type: ignore
self._backend_info.averaged_edge_gate_errors, # type: ignore
self._backend_info.averaged_readout_errors, # type: ignore
)

passlist.append(
Expand Down
Loading

0 comments on commit ee1e3b3

Please sign in to comment.