@@ -86,29 +86,21 @@ def test_thermal(backend):
8686 time = 100
8787
8888 t1 = 180
89- print (t1 , t2 )
9089 kraus = tc .channels .thermalrelaxationchannel (t1 , t2 , time , "general" , 0.1 )
9190 supop1 = tc .channels .kraus_to_super (kraus )
92- # print(kraus)
93- # print(supop1)
9491
9592 kraus = tc .channels .thermalrelaxationchannel (t1 , t2 , time , "T1dom" , 0.1 )
9693 supop2 = tc .channels .kraus_to_super (kraus )
97- # print(kraus)
98- # print(supop2)
94+
9995 np .testing .assert_allclose (supop1 , supop2 , atol = 1e-5 )
10096
10197 t1 = 80
102- print (t1 , t2 )
10398 kraus = tc .channels .thermalrelaxationchannel (t1 , t2 , time , "general" , 0.1 )
10499 supop1 = tc .channels .kraus_to_super (kraus )
105- # print(kraus)
106- # print(supop1)
107100
108101 kraus = tc .channels .thermalrelaxationchannel (t1 , t2 , time , "T2dom" , 0.1 )
109102 supop2 = tc .channels .kraus_to_super (kraus )
110- # print(kraus)
111- # print(supop2)
103+
112104 np .testing .assert_allclose (supop1 , supop2 , atol = 1e-5 )
113105
114106
@@ -117,17 +109,26 @@ def test_noisecircuit(backend):
117109
118110 # Monte carlo simulation
119111 def noisecircuit (X ):
120- noise = tc .channels .thermalrelaxationchannel (300 , 400 , 1000 , "T2dom" , 0 )
121112
122113 n = 1
123114 c = tc .Circuit (n )
124115 c .x (0 )
125- c .general_kraus (noise , 0 , status = X )
116+ # noise = tc.channels.thermalrelaxationchannel(300, 400, 1000, "T2dom", 0)
117+ # c.general_kraus(noise, 0, status=X)
118+ c .thermalrelaxation (
119+ 0 ,
120+ t1 = 300 ,
121+ t2 = 400 ,
122+ time = 1000 ,
123+ method = "T2dom" ,
124+ excitedstatepopulation = 0 ,
125+ status = X ,
126+ )
127+
126128 val = c .expectation_ps (z = [0 ])
127129 return val
128130
129- noisec = noisecircuit
130- noisec_vmap = tc .backend .vmap (noisec , vectorized_argnums = 0 )
131+ noisec_vmap = tc .backend .vmap (noisecircuit , vectorized_argnums = 0 )
131132 noisec_jit = tc .backend .jit (noisec_vmap )
132133
133134 nmc = 1000
@@ -145,9 +146,7 @@ def noisecircuitdm():
145146 val = dmc .expectation_ps (z = [0 ])
146147 return val
147148
148- noisec = noisecircuitdm
149- noisec_jit = tc .backend .jit (noisec )
150-
149+ noisec_jit = tc .backend .jit (noisecircuitdm )
151150 valuedm = noisec_jit ()
152151
153152 np .testing .assert_allclose (valuemc , valuedm , atol = 1e-1 )
0 commit comments