Skip to content

Commit

Permalink
test: Set up test for updating parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Nov 6, 2024
1 parent 6542f2c commit ebcd1a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from qibolab._core.components.configs import Config
from qibolab._core.native import Native, TwoQubitNatives
from qibolab._core.parameters import ConfigKinds, Parameters, TwoQubitContainer
from qibolab._core.platform.load import create_platform
from qibolab._core.pulses.pulse import Pulse


def test_two_qubit_container():
Expand Down Expand Up @@ -77,3 +79,12 @@ def test_within_parameters(self):

reloaded = Parameters.model_validate(dump)
assert reloaded == pars


def test_update():
dummy = create_platform("dummy")
dummy.update({})

assert isinstance(dummy.parameters.native_gates.single_qubit[1].RX[0][1], Pulse)
assert dummy.parameters.native_gates.single_qubit[1].RX[0][1].amplitude > 0
dummy.update({"native_gates.single_qubit.1.RX.0.1.amplitude": -0.5})

0 comments on commit ebcd1a6

Please sign in to comment.