Skip to content

Commit

Permalink
docs: Drop usage of loader functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Aug 12, 2024
1 parent 65c7eb7 commit 8c9ff56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 34 deletions.
16 changes: 5 additions & 11 deletions doc/source/getting-started/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ In this example, the qubit is controlled by a Zurich Instruments' SHFQC instrume
)
from qibolab.instruments.zhinst import ZiChannel, Zurich
from qibolab.platform import Platform
from qibolab.serialize import (
load_instrument_settings,
load_qubits,
load_runcard,
load_settings,
)
from qibolab.serialize import Runcard

NAME = "my_platform" # name of the platform
ADDRESS = "localhost" # ip address of the ZI data server
Expand All @@ -61,8 +56,9 @@ In this example, the qubit is controlled by a Zurich Instruments' SHFQC instrume
device_setup.add_instruments(SHFQC("device_shfqc", address="DEV12146"))

# Load and parse the runcard (i.e. parameters.json)
runcard = load_runcard(FOLDER)
qubits, _, pairs = load_qubits(runcard)
runcard = Runcard.load(FOLDER)
qubits = runcard.native_gates.single_qubit
pairs = runcard.native_gates.pairs
qubit = qubits[0]

# define component names, and load their configurations
Expand Down Expand Up @@ -90,15 +86,13 @@ In this example, the qubit is controlled by a Zurich Instruments' SHFQC instrume

controller = Zurich(NAME, device_setup=device_setup, channels=zi_channels)

instruments = load_instrument_settings(runcard, {controller.name: controller})
settings = load_settings(runcard)
return Platform(
NAME,
qubits,
pairs,
configs,
instruments,
settings,
settings=runcard.settings,
resonator_type="3D",
)

Expand Down
37 changes: 14 additions & 23 deletions doc/source/tutorials/lab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,7 @@ the above runcard:
DcConfig,
IqConfig,
)
from qibolab.serialize import (
load_runcard,
load_qubits,
load_settings,
)
from qibolab.serialize import Runcard
from qibolab.instruments.dummy import DummyInstrument

FOLDER = Path.cwd()
Expand All @@ -505,8 +501,9 @@ the above runcard:
instrument = DummyInstrument("my_instrument", "0.0.0.0:0")

# create ``Qubit`` and ``QubitPair`` objects by loading the runcard
runcard = load_runcard(folder)
qubits, _, pairs = load_qubits(runcard)
runcard = Runcard.load(folder)
qubits = runcard.native_gates.single_qubit
pairs = runcard.native_gates.pairs

# define channels and load component configs
configs = {}
Expand Down Expand Up @@ -534,14 +531,13 @@ the above runcard:
# create dictionary of instruments
instruments = {instrument.name: instrument}
# load ``settings`` from the runcard
settings = load_settings(runcard)
return Platform(
"my_platform",
qubits,
pairs,
configs,
instruments,
settings,
settings=runcard.settings,
resonator_type="2D",
)

Expand All @@ -557,8 +553,10 @@ With the following additions for coupler architectures:
instrument = DummyInstrument("my_instrument", "0.0.0.0:0")

# create ``Qubit`` and ``QubitPair`` objects by loading the runcard
runcard = load_runcard(folder)
qubits, couplers, pairs = load_qubits(runcard)
runcard = Runcard.load(folder)
qubits = runcard.native_gates.single_qubit
couplers = runcard.native_gates.coupler
pairs = runcard.native_gates.pairs

# define channels and load component configs
configs = {}
Expand Down Expand Up @@ -656,11 +654,7 @@ in this case ``"twpa_pump"``.
DcConfig,
IqConfig,
)
from qibolab.serialize import (
load_runcard,
load_qubits,
load_settings,
)
from qibolab.serialize import Runcard
from qibolab.instruments.dummy import DummyInstrument

FOLDER = Path.cwd()
Expand All @@ -672,8 +666,9 @@ in this case ``"twpa_pump"``.
instrument = DummyInstrument("my_instrument", "0.0.0.0:0")

# create ``Qubit`` and ``QubitPair`` objects by loading the runcard
runcard = load_runcard(folder)
qubits, _, pairs = load_qubits(runcard)
runcard = Runcard.load(folder)
qubits = runcard.native_gates.single_qubit
pairs = runcard.native_gates.pairs

# define channels and load component configs
configs = {}
Expand All @@ -700,16 +695,12 @@ in this case ``"twpa_pump"``.
# create dictionary of instruments
instruments = {instrument.name: instrument}
# load instrument settings from the runcard
instruments = load_instrument_settings(runcard, instruments)
# load ``settings`` from the runcard
settings = load_settings(runcard)
return Platform(
"my_platform",
qubits,
pairs,
configs,
instruments,
settings,
settings=runcard.settings,
resonator_type="2D",
)

0 comments on commit 8c9ff56

Please sign in to comment.