Skip to content

Commit

Permalink
Revert "Merge pull request #26 from aws/oqc-fix-type-hint"
Browse files Browse the repository at this point in the history
This reverts commit 8ed8fb7, reversing
changes made to 35fd178.
  • Loading branch information
Matt Cordoba committed Mar 23, 2022
1 parent 8ed8fb7 commit 26f8082
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
14 changes: 8 additions & 6 deletions src/braket/device_schema/oqc/oqc_provider_properties_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
# TODO: Replace the calibration data with actual values we receive from the device.


OneQubitType = TypeVar("OneQubitType", bound=Dict[str, Union[float, int]])
OneQubitType = TypeVar("OneQubitType", bound=Union[int, Dict[str, Union[float, int]]])
TwoQubitType = TypeVar("TwoQubitType", bound=Dict[str, Union[float, Dict[str, int]]])

QubitType = TypeVar("QubitType", bound=Dict[str, Union[OneQubitType, TwoQubitType]])


class OqcProviderProperties(BraketSchemaBase):
"""
This defines the properties common to all the OQC devices.
Attributes:
specs (Dict[str, Dict[str, Union[OneQubitType, TwoQubitType]]]): Basic specifications for
specs (Dict[str, Dict[str, Union[OneQubitType, TwoQubitType]]): Basic specifications for
the device, such as gate fidelities and coherence times.
Examples:
Expand All @@ -40,7 +42,7 @@ class OqcProviderProperties(BraketSchemaBase):
... "version": "1",
... },
... "specs": {
... "1Q": {
... "one_qubit": {
... "0": {
... "T1": 28.9,
... "T2": 44.5,
Expand All @@ -49,13 +51,13 @@ class OqcProviderProperties(BraketSchemaBase):
... "qubit": 0
... },
... },
... "2Q": {
... "two_qubit": {
... "0-1": {
... "coupling": {
... "control_qubit": 0,
... "target_qubit": 1
... },
... "fCNOT": 87.7
... "fCX": 87.7
... },
... }
... },
Expand All @@ -67,4 +69,4 @@ class OqcProviderProperties(BraketSchemaBase):
name="braket.device_schema.oqc.oqc_provider_properties", version="1"
)
braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER)
specs: Dict[str, Dict[str, Union[OneQubitType, TwoQubitType]]]
specs: Dict[str, Dict[str, QubitType]]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def valid_input():
"version": "1",
},
"specs": {
"1Q": {
"one_qubit": {
"0": {"T1": 12.2, "T2": 13.5, "fRO": 0.99, "fRB": 0.98, "qubit": 0},
"1": {"T1": 12.2, "T2": 13.5, "fRO": 0.99, "fRB": 0.98, "qubit": 1},
"2": {"T1": 12.2, "T2": 13.5, "fRO": 0.99, "fRB": 0.98, "qubit": 2},
Expand All @@ -37,38 +37,38 @@ def valid_input():
"6": {"T1": 12.2, "T2": 13.5, "fRO": 0.99, "fRB": 0.98, "qubit": 6},
"7": {"T1": 12.2, "T2": 13.5, "fRO": 0.99, "fRB": 0.98, "qubit": 7},
},
"2Q": {
"two_qubit": {
"0-1": {
"coupling": {"control_qubit": 0, "target_qubit": 1},
"fCNOT": 0.99,
"fCX": 0.99,
},
"1-2": {
"coupling": {"control_qubit": 1, "target_qubit": 2},
"fCNOT": 0.99,
"fCX": 0.99,
},
"2-3": {
"coupling": {"control_qubit": 2, "target_qubit": 3},
"fCNOT": 0.99,
"fCX": 0.99,
},
"3-4": {
"coupling": {"control_qubit": 3, "target_qubit": 4},
"fCNOT": 0.99,
"fCX": 0.99,
},
"4-5": {
"coupling": {"control_qubit": 4, "target_qubit": 5},
"fCNOT": 0.99,
"fCX": 0.99,
},
"5-6": {
"coupling": {"control_qubit": 5, "target_qubit": 6},
"fCNOT": 0.99,
"fCX": 0.99,
},
"6-7": {
"coupling": {"control_qubit": 6, "target_qubit": 7},
"fCNOT": 0.99,
"fCX": 0.99,
},
"7-0": {
"coupling": {"control_qubit": 7, "target_qubit": 0},
"fCNOT": 0.99,
"fCX": 0.99,
},
},
},
Expand Down

0 comments on commit 26f8082

Please sign in to comment.