Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CZ implementations may be nonsymmetric, only calibrated locus orders must be used. #140

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 15.6
============

* CZ gates now appear in the transpilation target only in the direction they are calibrated. `#140 <https://github.com/iqm-finland/qiskit-on-iqm/pull/140>`_

Version 15.5
============

Expand Down
23 changes: 9 additions & 14 deletions src/iqm/qiskit_iqm/fake_backends/fake_adonis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,19 @@
# limitations under the License.
"""Fake backend for IQM's 5-qubit Adonis architecture.
"""
from iqm.iqm_client import QuantumArchitectureSpecification
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import IQMErrorProfile, IQMFakeBackend
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import (
IQMErrorProfile,
IQMFakeBackend,
generate_architecture_from_lists,
)


def IQMFakeAdonis() -> IQMFakeBackend:
"""Return IQMFakeBackend instance representing IQM's Adonis architecture."""
architecture = QuantumArchitectureSpecification(
name="Adonis",
operations={
"prx": [["QB1"], ["QB2"], ["QB3"], ["QB4"], ["QB5"]],
"cc_prx": [["QB1"], ["QB2"], ["QB3"], ["QB4"], ["QB5"]],
"cz": [["QB1", "QB3"], ["QB2", "QB3"], ["QB4", "QB3"], ["QB5", "QB3"]],
"measure": [["QB1"], ["QB2"], ["QB3"], ["QB4"], ["QB5"]],
"barrier": [],
},
qubits=["QB1", "QB2", "QB3", "QB4", "QB5"],
qubit_connectivity=[["QB1", "QB3"], ["QB2", "QB3"], ["QB3", "QB4"], ["QB3", "QB5"]],
)

qubits = ["QB1", "QB2", "QB3", "QB4", "QB5"]
qubit_connectivity = [["QB1", "QB3"], ["QB2", "QB3"], ["QB3", "QB4"], ["QB3", "QB5"]]
architecture = generate_architecture_from_lists(qubits, qubit_connectivity)
error_profile = IQMErrorProfile(
t1s={"QB1": 27000.0, "QB2": 33000.0, "QB3": 25000.0, "QB4": 40000.0, "QB5": 25000.0},
t2s={"QB1": 20000.0, "QB2": 26000.0, "QB3": 23000.0, "QB4": 26000.0, "QB5": 7000.0},
Expand Down
19 changes: 6 additions & 13 deletions src/iqm/qiskit_iqm/fake_backends/fake_aphrodite.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# limitations under the License.
"""Fake (i.e. simulated) backend for IQM's 54-qubit Aphrodite architecture
"""
from iqm.iqm_client import QuantumArchitectureSpecification
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import IQMErrorProfile, IQMFakeBackend
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import (
IQMErrorProfile,
IQMFakeBackend,
generate_architecture_from_lists,
)


def IQMFakeAphrodite() -> IQMFakeBackend:
Expand Down Expand Up @@ -168,17 +171,7 @@ def IQMFakeAphrodite() -> IQMFakeBackend:
["QB52", "QB53"],
["QB53", "QB54"],
]
architecture = QuantumArchitectureSpecification(
name="Aphrodite",
operations={
"prx": [[q] for q in qubits],
"cz": list(qubit_connectivity),
"measure": [[q] for q in qubits],
"barrier": [],
},
qubits=qubits,
qubit_connectivity=qubit_connectivity,
)
architecture = generate_architecture_from_lists(qubits, qubit_connectivity)

error_profile = IQMErrorProfile(
t1s={
Expand Down
19 changes: 6 additions & 13 deletions src/iqm/qiskit_iqm/fake_backends/fake_apollo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# limitations under the License.
"""Fake (i.e. simulated) backend for IQM's 20-qubit Apollo architecture
"""
from iqm.iqm_client import QuantumArchitectureSpecification
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import IQMErrorProfile, IQMFakeBackend
from iqm.qiskit_iqm.fake_backends.iqm_fake_backend import (
IQMErrorProfile,
IQMFakeBackend,
generate_architecture_from_lists,
)


def IQMFakeApollo() -> IQMFakeBackend:
Expand Down Expand Up @@ -73,17 +76,7 @@ def IQMFakeApollo() -> IQMFakeBackend:
["QB18", "QB19"],
["QB19", "QB20"],
]
architecture = QuantumArchitectureSpecification(
name="Apollo",
operations={
"prx": [[q] for q in qubits],
"cz": list(qubit_connectivity),
"measure": [[q] for q in qubits],
"barrier": [],
},
qubits=qubits,
qubit_connectivity=qubit_connectivity,
)
architecture = generate_architecture_from_lists(qubits, qubit_connectivity)
# Note that these specs are ballpark numbers and don't correspond directly to a specific device
error_profile = IQMErrorProfile(
t1s={
Expand Down
23 changes: 23 additions & 0 deletions src/iqm/qiskit_iqm/fake_backends/iqm_fake_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,26 @@ def validate_compatible_architecture(self, architecture: DynamicQuantumArchitect
connectivity_match = self_connectivity == target_connectivity

return components_match and ops_match and connectivity_match


def generate_architecture_from_lists(
qubits: list[str], qubit_connectivity: list[list[str]]
) -> QuantumArchitectureSpecification:
"""Generate a Dynamic Quantum Architecture from lists of qubits and qubit connectivity.

Args:
qubits: list of qubit names
qubit_connectivity: list of lists of qubit pairs representing connectivity
"""
return QuantumArchitectureSpecification(
name="Adonis",
operations={
"prx": [[q] for q in qubits],
"cc_prx": [[q] for q in qubits],
"cz": list(qubit_connectivity),
"measure": [[q] for q in qubits],
"barrier": [],
},
qubits=qubits,
qubit_connectivity=qubit_connectivity,
)
2 changes: 1 addition & 1 deletion src/iqm/qiskit_iqm/iqm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _create_properties(
if 'prx' in operations:
target.add_instruction(RGate(Parameter('theta'), Parameter('phi')), _create_properties('prx'))
if 'cz' in operations:
target.add_instruction(CZGate(), _create_properties('cz', symmetric=True))
target.add_instruction(CZGate(), _create_properties('cz'))
if 'move' in operations:
target.add_instruction(MoveGate(), _create_properties('move'))
if 'cc_prx' in operations:
Expand Down
Loading
Loading