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

Lift sequence #986

Merged
merged 5 commits into from
Aug 18, 2024
Merged
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
2 changes: 1 addition & 1 deletion doc/source/getting-started/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ We leave to the dedicated tutorial a full explanation of the experiment, but her
import matplotlib.pyplot as plt

from qibolab import create_platform
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.result import magnitude
from qibolab.sweeper import Sweeper, SweeperType, Parameter
from qibolab.execution_parameters import (
Expand Down
8 changes: 5 additions & 3 deletions doc/source/main-documentation/qibolab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Now we can create a simple sequence (again, without explicitly giving any qubit

.. testcode:: python

from qibolab.pulses import PulseSequence, Delay
from qibolab.pulses import Delay
from qibolab.sequence import PulseSequence
import numpy as np

ps = PulseSequence()
Expand Down Expand Up @@ -276,7 +277,7 @@ To organize pulses into sequences, Qibolab provides the :class:`qibolab.pulses.P

.. testcode:: python

from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence


pulse1 = Pulse(
Expand Down Expand Up @@ -460,7 +461,8 @@ For example:

.. testcode:: python

from qibolab.pulses import PulseSequence, Delay
from qibolab.pulses import Delay
from qibolab.sequence import PulseSequence

qubit = platform.qubits[0]
natives = platform.natives.single_qubit[0]
Expand Down
8 changes: 5 additions & 3 deletions doc/source/tutorials/calibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ around the pre-defined frequency.

import numpy as np
from qibolab import create_platform
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.result import magnitude
from qibolab.sweeper import Sweeper, SweeperType, Parameter
from qibolab.execution_parameters import (
Expand Down Expand Up @@ -111,7 +111,8 @@ complex pulse sequence. Therefore with start with that:
import numpy as np
import matplotlib.pyplot as plt
from qibolab import create_platform
from qibolab.pulses import Pulse, PulseSequence, Delay, Gaussian
from qibolab.pulses import Pulse, Delay, Gaussian
from qibolab.sequence import PulseSequence
from qibolab.result import magnitude
from qibolab.sweeper import Sweeper, SweeperType, Parameter
from qibolab.execution_parameters import (
Expand Down Expand Up @@ -215,7 +216,8 @@ and its impact on qubit states in the IQ plane.
import numpy as np
import matplotlib.pyplot as plt
from qibolab import create_platform
from qibolab.pulses import PulseSequence, Delay
from qibolab.pulses import Delay
from qibolab.sequence import PulseSequence
from qibolab.result import unpack
from qibolab.sweeper import Sweeper, SweeperType, Parameter
from qibolab.execution_parameters import (
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials/compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following example shows how to modify the compiler in order to execute a cir
from qibo import gates
from qibo.models import Circuit
from qibolab.backends import QibolabBackend
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence

# define the circuit
circuit = Circuit(1)
Expand Down
6 changes: 4 additions & 2 deletions doc/source/tutorials/lab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ the native gates, but separately from the single-qubit ones.
from qibolab.components import IqChannel, AcquireChannel, DcChannel, IqConfig
from qibolab.qubits import Qubit
from qibolab.parameters import Parameters, TwoQubitContainer
from qibolab.pulses import Gaussian, Pulse, PulseSequence, Rectangular
from qibolab.pulses import Gaussian, Pulse, Rectangular
from qibolab.sequence import PulseSequence
from qibolab.native import (
RxyFactory,
FixedSequenceFactory,
Expand Down Expand Up @@ -207,7 +208,8 @@ will take them into account when calling :class:`qibolab.native.TwoQubitNatives`

from qibolab.components import DcChannel
from qibolab.qubits import Qubit
from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.sequence import PulseSequence
from qibolab.native import (
FixedSequenceFactory,
SingleQubitNatives,
Expand Down
3 changes: 2 additions & 1 deletion doc/source/tutorials/pulses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ pulses (:class:`qibolab.pulses.Pulse`) through the

.. testcode:: python

from qibolab.pulses import Pulse, PulseSequence, Rectangular, Gaussian, Delay
from qibolab.pulses import Pulse, Rectangular, Gaussian, Delay
from qibolab.sequence import PulseSequence

# Define PulseSequence
sequence = PulseSequence(
Expand Down
3 changes: 2 additions & 1 deletion examples/minimum_working_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from qibolab import create_platform
from qibolab.paths import qibolab_folder
from qibolab.pulses import Pulse, PulseSequence, ReadoutPulse
from qibolab.pulses import Pulse, ReadoutPulse
from qibolab.sequence import PulseSequence

# Define PulseSequence
sequence = PulseSequence()
Expand Down
2 changes: 1 addition & 1 deletion extras/test819.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)
from qibolab.instruments.qblox.controller import QbloxController
from qibolab.platform import NS_TO_SEC
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType

GlobalBackend.set_backend("qibolab", "spinq10q")
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/compilers/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
z_rule,
)
from qibolab.platform import Platform
from qibolab.pulses import Delay, PulseSequence
from qibolab.pulses import Delay
from qibolab.qubits import QubitId
from qibolab.sequence import PulseSequence

Rule = Callable[..., PulseSequence]
"""Compiler rule."""
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/compilers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from qibo.gates import Align, Gate

from qibolab.native import SingleQubitNatives, TwoQubitNatives
from qibolab.pulses import Delay, PulseSequence, VirtualZ
from qibolab.pulses import Delay, VirtualZ
from qibolab.qubits import Qubit
from qibolab.sequence import PulseSequence


def z_rule(gate: Gate, qubit: Qubit) -> PulseSequence:
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from qibolab.components import Config
from qibolab.execution_parameters import ExecutionParameters
from qibolab.pulses.sequence import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers

InstrumentId = str
Expand Down
4 changes: 2 additions & 2 deletions src/qibolab/instruments/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from qibo.config import log

from qibolab import AcquisitionType, AveragingMode, ExecutionParameters
from qibolab.pulses import PulseSequence
from qibolab.pulses.pulse import Pulse
from qibolab.pulses import Pulse
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers
from qibolab.unrolling import Bounds

Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/emulator/pulse_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from qibolab.instruments.abstract import Controller
from qibolab.instruments.emulator.engines.qutip_engine import QutipSimulator
from qibolab.instruments.emulator.models import general_no_coupler_model
from qibolab.pulses import PulseSequence
from qibolab.qubits import Qubit, QubitId
from qibolab.result import average, collect
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType

AVAILABLE_SWEEP_PARAMETERS = {
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/icarusqfpga.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
ExecutionParameters,
)
from qibolab.instruments.abstract import Controller
from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.qubits import Qubit, QubitId
from qibolab.result import average, average_iq, collect
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType

DAC_SAMPLNG_RATE_MHZ = 5898.24
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qblox/cluster_qcm_bb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
)
from qibolab.instruments.qblox.sequencer import Sequencer, WaveformsBuffer
from qibolab.instruments.qblox.sweeper import QbloxSweeper, QbloxSweeperType
from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType


Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qblox/cluster_qcm_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
)
from qibolab.instruments.qblox.sequencer import Sequencer, WaveformsBuffer
from qibolab.instruments.qblox.sweeper import QbloxSweeper, QbloxSweeperType
from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType


Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qblox/cluster_qrm_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from qblox_instruments.qcodes_drivers.module import Module
from qibo.config import log

from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType

from .acquisition import AveragedAcquisition, DemodulatedAcquisition
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/qblox/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from qibolab.instruments.qblox.cluster_qcm_rf import QcmRf
from qibolab.instruments.qblox.cluster_qrm_rf import QrmRf
from qibolab.instruments.qblox.sequencer import SAMPLING_RATE
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper, SweeperType
from qibolab.unrolling import Bounds

Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qblox/sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from qblox_instruments.qcodes_drivers.sequencer import Sequencer as QbloxSequencer

from qibolab.instruments.qblox.q1asm import Program
from qibolab.pulses import Pulse, PulseSequence
from qibolab.pulses import Pulse
from qibolab.pulses.modulation import modulate
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper

SAMPLING_RATE = 1
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qm/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from qibolab.components import Channel, ChannelId, Config, DcChannel, IqChannel
from qibolab.execution_parameters import ExecutionParameters
from qibolab.instruments.abstract import Controller
from qibolab.pulses import Delay, Pulse, PulseSequence, VirtualZ
from qibolab.pulses import Delay, Pulse, VirtualZ
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers, Parameter
from qibolab.unrolling import Bounds

Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/qm/program/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from qm.qua._dsl import _Variable # for type declaration only

from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence

from .acquisition import Acquisition

Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/qm/program/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from qibolab.components import Config
from qibolab.execution_parameters import AcquisitionType, ExecutionParameters
from qibolab.pulses import Delay, PulseSequence
from qibolab.pulses import Delay
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers

from ..config import operation
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/rfsoc/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import qibosoq.components.base as rfsoc
import qibosoq.components.pulses as rfsoc_pulses

from qibolab.pulses import Envelope, Pulse, PulseSequence
from qibolab.pulses import Envelope, Pulse
from qibolab.qubits import Qubit
from qibolab.sequence import PulseSequence
from qibolab.sweeper import BIAS, DURATION, Parameter, Sweeper

HZ_TO_MHZ = 1e-6
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/rfsoc/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from qibolab import AcquisitionType, AveragingMode, ExecutionParameters
from qibolab.instruments.abstract import Controller
from qibolab.pulses import PulseSequence
from qibolab.qubits import Qubit
from qibolab.sequence import PulseSequence
from qibolab.sweeper import BIAS, Sweeper

from .convert import convert, convert_units_sweeper
Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/instruments/zhinst/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

from qibolab import AcquisitionType, AveragingMode, ExecutionParameters
from qibolab.instruments.abstract import Controller
from qibolab.pulses import Delay, Pulse, PulseSequence
from qibolab.pulses import Delay, Pulse
from qibolab.sequence import PulseSequence
from qibolab.sweeper import Parameter, Sweeper
from qibolab.unrolling import Bounds

Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import numpy as np

from .pulses import Drag, Gaussian, Pulse, PulseSequence
from .pulses import Drag, Gaussian, Pulse
from .sequence import PulseSequence
from .serialize import Model, replace


Expand Down
5 changes: 3 additions & 2 deletions src/qibolab/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
from qibolab.execution_parameters import ExecutionParameters
from qibolab.instruments.abstract import Controller, Instrument, InstrumentId
from qibolab.parameters import NativeGates, Parameters, Settings, update_configs
from qibolab.pulses import Delay, PulseSequence
from qibolab.pulses import Delay
from qibolab.qubits import Qubit, QubitId, QubitPairId
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers
from qibolab.unrolling import Bounds, batch

Expand Down Expand Up @@ -252,7 +253,7 @@ def execute(
import numpy as np
from qibolab.dummy import create_dummy
from qibolab.sweeper import Sweeper, Parameter
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.execution_parameters import ExecutionParameters


Expand Down
3 changes: 1 addition & 2 deletions src/qibolab/pulses/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from .envelope import *
from .pulse import Delay, Pulse, VirtualZ
from .sequence import PulseSequence
from .pulse import Delay, Pulse, PulseLike, VirtualZ
3 changes: 2 additions & 1 deletion src/qibolab/pulses/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import matplotlib.pyplot as plt
import numpy as np

from qibolab.sequence import PulseSequence

from .envelope import Waveform
from .modulation import modulate
from .pulse import Delay, Pulse, VirtualZ
from .sequence import PulseSequence

SAMPLING_RATE = 1
"""Default sampling rate in gigasamples per second (GSps).
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/pulses/sequence.py → src/qibolab/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from qibolab.components import ChannelId

from .pulse import Delay, Pulse, PulseLike
from .pulses import Delay, Pulse, PulseLike

__all__ = ["PulseSequence"]

Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Sweeper:
import numpy as np
from qibolab.dummy import create_dummy
from qibolab.sweeper import Sweeper, Parameter
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab import ExecutionParameters


Expand Down
3 changes: 2 additions & 1 deletion src/qibolab/unrolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from qibolab.components.configs import BoundsConfig
from qibolab.serialize import Model

from .pulses import Pulse, PulseSequence
from .pulses import Pulse
from .pulses.envelope import Rectangular
from .sequence import PulseSequence


def _waveform(sequence: PulseSequence):
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
create_platform,
)
from qibolab.platform.load import PLATFORMS
from qibolab.pulses import PulseSequence
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers, Parameter, Sweeper

ORIGINAL_PLATFORMS = os.environ.get(PLATFORMS, "")
Expand Down
2 changes: 1 addition & 1 deletion tests/pulses/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
GaussianSquare,
Iir,
Pulse,
PulseSequence,
Rectangular,
Snz,
plot,
)
from qibolab.pulses.modulation import modulate
from qibolab.sequence import PulseSequence

HERE = pathlib.Path(__file__).parent
SAMPLING_RATE = 1
Expand Down
Loading