Exemplo n.º 1
0
def test_ramsey_sequence():
    """
    Tests the Ramsey sequence.
    """

    duration = 10.0

    sequence = new_ramsey_sequence(duration=duration)

    _offsets = np.array([])
    _rabi_rotations = np.array([])
    _azimuthal_angles = np.array([])
    _detuning_rotations = np.array([])

    assert np.allclose(_offsets, sequence.offsets)
    assert np.allclose(_rabi_rotations, sequence.rabi_rotations)
    assert np.allclose(_azimuthal_angles, sequence.azimuthal_angles)
    assert np.allclose(_detuning_rotations, sequence.detuning_rotations)

    sequence = new_ramsey_sequence(duration=duration, pre_post_rotation=True)

    _rabi_rotations = np.array([np.pi / 2, np.pi / 2])
    _azimuthal_angles = np.array([0.0, np.pi])
    _detuning_rotations = np.array([0.0, 0.0])

    assert np.allclose(_rabi_rotations, sequence.rabi_rotations)
    assert np.allclose(_azimuthal_angles, sequence.azimuthal_angles)
    assert np.allclose(_detuning_rotations, sequence.detuning_rotations)
Exemplo n.º 2
0
def test_if_ramsey_sequence_is_identity():
    """
    Tests if the product of the pulses in the Ramsey sequence with pre/post
    pi/2-pulses is an identity.
    """
    ramsey_sequence = new_ramsey_sequence(duration=10.0, pre_post_rotation=True)

    assert _pulses_produce_identity(ramsey_sequence)