File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 2
2
testing module quick setup class
3
3
"""
4
4
5
+ import numpy as np
5
6
import pytest
7
+ import pickle
6
8
from c3 .experiment import Experiment
7
9
8
10
exp = Experiment ()
@@ -23,3 +25,14 @@ def test_exp_quick_setup_freqs() -> None:
23
25
carrier_freq = gate .comps ["d1" ]["carrier" ].params ["freq" ].get_value ()
24
26
offset = gate .comps ["d1" ]["gaussian" ].params ["freq_offset" ].get_value ()
25
27
assert qubit_freq == carrier_freq + offset
28
+
29
+ @pytest .mark .integration
30
+ def test_generator () -> None :
31
+ gen_signal = pmap .generator .generate_signals (pmap .instructions ["rx90p[0]" ])
32
+ with open ("test/quick_data.pickle" , "rb" ) as quickfile :
33
+ test_data = pickle .load (quickfile )
34
+ np .testing .assert_allclose (gen_signal ["d1" ]["ts" ], test_data ["d1" ]["ts" ])
35
+ np .testing .assert_allclose (
36
+ actual = gen_signal ["d1" ]["values" ].numpy (),
37
+ desired = test_data ["d1" ]["values" ].numpy (),
38
+ )
You can’t perform that action at this time.
0 commit comments