Ejemplo n.º 1
0
def TestDrift():
    """
    Test for Drift
    """
    drift = Drift()
    assert_allclose(drift.get_ideal_qobjevo(2).cte.norm(), 0)
    drift.add_drift(sigmaz(), targets=1)
    assert_allclose(
        drift.get_ideal_qobjevo(dims=[3, 2]).cte, tensor(identity(3), sigmaz()))
Ejemplo n.º 2
0
 def __init__(self, N, t1=None, t2=None,
              dims=None, spline_kind="step_func"):
     self.N = N
     self.pulses = []
     self.t1 = t1
     self.t2 = t2
     self.noise = []
     self.drift = Drift()
     if dims is None:
         self.dims = [2] * N
     else:
         self.dims = dims
     self.pulse_mode = "discrete"
     self.spline_kind = spline_kind