コード例 #1
0
def test_counterfeit_attack_wiesner_money_primal_problem_rep_2():
    """Counterfeit attack with 2 parallel repetitions (primal problem)."""
    reps = 2
    res = optimal_clone(states, probs, reps, True)
    np.testing.assert_equal(np.isclose(res, (3 / 4) ** reps), True)
コード例 #2
0
def test_counterfeit_attack_wiesner_money_rep_2():
    """Probability of counterfeit attack with 2 parallel repetitions."""
    reps = 2

    res = optimal_clone(states, probs, reps)
    np.testing.assert_equal(np.isclose(res, (3 / 4) ** reps), True)
コード例 #3
0
def test_counterfeit_attack_wiesner_money_primal_problem():
    """Counterfeit attack on Wiesner's quantum money (primal problem)."""
    res = optimal_clone(states, probs, 1, True)
    np.testing.assert_equal(np.isclose(res, 3 / 4), True)
コード例 #4
0
def test_counterfeit_attack_wiesner_money():
    """Probability of counterfeit attack on Wiesner's quantum money."""
    res = optimal_clone(states, probs)
    np.testing.assert_equal(np.isclose(res, 3 / 4), True)