Beispiel #1
0
def test_damping_after_dephasing():
    damping = damping_kraus_map(p=1 - np.exp(-.1))
    dephasing = dephasing_kraus_map(p=.5 * (1 - np.exp(-.2)))
    ks_ref = combine_kraus_maps(damping, dephasing)

    ks_actual = damping_after_dephasing(10, 10, 1)
    np.testing.assert_allclose(ks_actual, ks_ref)
Beispiel #2
0
def amp_damp_i_gate(p=.1):
    """
    Create amplitude damped Identity gate
    """
    corrupted_i = append_kraus_to_gate(damping_kraus_map(p),
                                       np.array([[1, 0], [0, 1]]))
    return corrupted_i
Beispiel #3
0
def test_damping_after_dephasing():
    damping = damping_kraus_map(p=1 - np.exp(-0.1))
    dephasing = dephasing_kraus_map(p=0.5 * (1 - np.exp(-0.2)))
    ks_ref = combine_kraus_maps(damping, dephasing)

    ks_actual = damping_after_dephasing(20, 40 / 3.0, 2.0)
    np.testing.assert_allclose(ks_actual, ks_ref)
def test_damping_after_dephasing():
    damping = damping_kraus_map()
    dephasing = dephasing_kraus_map()
    ks_ref = combine_kraus_maps(damping, dephasing)

    ks_actual = damping_after_dephasing(10, 10, 1)
    np.testing.assert_allclose(ks_actual, ks_ref)
Beispiel #5
0
def test_combine_kraus_maps():
    damping = damping_kraus_map()
    dephasing = dephasing_kraus_map()
    k1, k2, k3, k4 = combine_kraus_maps(damping, dephasing)
    assert k1.shape == (2, 2)
    assert k2.shape == (2, 2)
    assert k3.shape == (2, 2)
    assert k4.shape == (2, 2)
Beispiel #6
0
def test_tensor_kraus_maps():
    damping = damping_kraus_map()
    k1, k2, k3, k4 = tensor_kraus_maps(damping, damping)
    assert k1.shape == (4, 4)
    assert k2.shape == (4, 4)
    assert k3.shape == (4, 4)
    assert k4.shape == (4, 4)
    np.testing.assert_allclose(k1[-1, -1], 1 - 0.1)
Beispiel #7
0
def test_damping_kraus_map():
    p = 0.05
    k1, k2 = damping_kraus_map(p=p)
    assert k1[1, 1] == np.sqrt(1 - p)
    assert k2[0, 1] == np.sqrt(p)