Skip to content
Merged
43 changes: 0 additions & 43 deletions source/pip/tests/test_cpu_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,49 +90,6 @@ def test_cpu_no_noise():
assert output == [[Result.Zero] * 16], "Expected result of 0s with pi/2 angles."


def test_cpu_bitflip_noise():
"""Bitflip noise for CPU simulator."""
qsharp.init(target_profile=TargetProfile.Base)
qsharp.eval(read_file_relative("CliffordIsing.qs"))

input = qsharp.compile(
"IsingModel2DEvolution(4, 4, PI() / 2.0, PI() / 2.0, 10.0, 10)"
)

p_noise = 0.005
noise = NoiseConfig()
noise.rx.set_bitflip(p_noise)
noise.rzz.set_pauli_noise("XX", p_noise)
noise.mresetz.set_bitflip(p_noise)

output = run_qir_cpu(str(input), shots=3, noise=noise, seed=17)
result = [result_array_to_string(cast(Sequence[Result], x)) for x in output]
print(result)
# Reasonable results obtained from manual run
assert result == ["1000010001000001", "0000000000000000", "0001000001100000"]


def test_cpu_mixed_noise():
qsharp.init(target_profile=TargetProfile.Base)
qsharp.eval(read_file_relative("CliffordIsing.qs"))

input = qsharp.compile(
"IsingModel2DEvolution(4, 4, PI() / 2.0, PI() / 2.0, 4.0, 4)"
)

noise = NoiseConfig()
noise.rz.set_bitflip(0.008)
noise.rz.loss = 0.005
noise.rzz.set_depolarizing(0.008)
noise.rzz.loss = 0.005

output = run_qir_cpu(str(input), shots=3, noise=noise, seed=53)
result = [result_array_to_string(cast(Sequence[Result], x)) for x in output]
print(result)
# Reasonable results obtained from manual run
assert result == ["000000000--00100", "0010001000000000", "0000000000010000"]


def test_cpu_isolated_loss():
qsharp.init(target_profile=TargetProfile.Base)
program = """
Expand Down
2 changes: 0 additions & 2 deletions source/pip/tests/test_simulators_gates_noisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ def test_loss_noise_produces_loss_marker(sim_type):
check_histogram(results, {"-": 0.1, "1": 0.9})


@pytest.mark.skip(reason="loss behavior in cpu and gpu simulators is different")
@pytest.mark.parametrize("sim_type", SIM_TYPES)
def test_two_qubit_loss(sim_type):
noise = NoiseConfig()
Expand Down Expand Up @@ -369,7 +368,6 @@ def test_noise_accumulates_across_multiple_gates(sim_type):
check_histogram(results, {"0": 0.82, "1": 0.18})


@pytest.mark.skip(reason="loss behavior in cpu and gpu simulators is different")
@pytest.mark.parametrize("sim_type", SIM_TYPES)
def test_bell_state_with_combined_noise(sim_type):
noise = NoiseConfig()
Expand Down
Loading
Loading