diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be813601e..cb0e77adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,4 +72,4 @@ jobs: - name: Test validation with legacy jsonschema run: | pip install jsonschema==4.17.3 - pytest tests/test_abstract_repr.py -W ignore::DeprecationWarning + pytest tests/test_abstract_repr.py -W ignore::DeprecationWarning \ No newline at end of file diff --git a/tests/test_simulation.py b/tests/test_simulation.py index b827a5673..4c1427b4a 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -858,17 +858,27 @@ def test_noises_digital(matrices, noise, result, n_collapse_ops, seq_digital): assert np.trace(trace_2) < 1 and not np.isclose(np.trace(trace_2), 1) +res_deph_relax = { + "000": 412, + "010": 230, + "001": 176, + "100": 174, + "101": 7, + "011": 1, +} + + @pytest.mark.parametrize( "noise, result, n_collapse_ops", [ ("dephasing", {"111": 958, "110": 19, "011": 12, "101": 11}, 2), ("eff_noise", {"111": 958, "110": 19, "011": 12, "101": 11}, 2), - ("relaxation", {"111": 1000}, 1), ( - ("dephasing", "relaxation"), - {"111": 958, "110": 19, "011": 12, "101": 11}, - 3, + "relaxation", + {"000": 421, "010": 231, "001": 172, "100": 171, "101": 5}, + 1, ), + (("dephasing", "relaxation"), res_deph_relax, 3), ( ("eff_noise", "dephasing"), {"111": 922, "110": 33, "011": 23, "101": 21, "100": 1}, @@ -876,8 +886,21 @@ def test_noises_digital(matrices, noise, result, n_collapse_ops, seq_digital): ), ], ) -def test_noises_all(matrices, noise, result, n_collapse_ops, seq): - # Test with Digital Sequence +def test_noises_all(matrices, reg, noise, result, n_collapse_ops, seq): + # Test with Digital+Rydberg Sequence + if "relaxation" in noise: + # Bring the states to ggg + seq.target("control1", "raman") + seq.add(pi_Y_pulse, "raman") + seq.target("target", "raman") + seq.add(pi_Y_pulse, "raman") + seq.target("control2", "raman") + seq.add(pi_Y_pulse, "raman") + # Apply a 2pi pulse on ggg + seq.declare_channel("ryd_glob", "rydberg_global") + seq.add(twopi_pulse, "ryd_glob") + # Measure in the rydberg basis + seq.measure() deph_op = qutip.Qobj([[1, 0, 0], [0, 0, 0], [0, 0, 0]]) hyp_deph_op = qutip.Qobj([[0, 0, 0], [0, 0, 0], [0, 0, 1]]) sim = QutipEmulator.from_sequence( @@ -887,7 +910,7 @@ def test_noises_all(matrices, noise, result, n_collapse_ops, seq): noise=noise, dephasing_rate=0.1, hyperfine_dephasing_rate=0.1, - relaxation_rate=1000, + relaxation_rate=1.0, eff_noise_opers=[deph_op, hyp_deph_op], eff_noise_rates=[0.2, 0.2], ),