def test_inputChecking():
    # ham = PauliSum.from_compact_str("0.7*Z0*Z1")
    ham = PauliSum([PauliTerm("Z", 0, 0.7) * PauliTerm("Z", 1)])
    betas = [1, 2, 3, 4]
    gammas_singles = []
    gammas_pairs = [1, 2, 3]
    with raises(ValueError):
        params = ExtendedParams((ham, 3),
                                (betas, gammas_singles, gammas_pairs))
def test_ExtendedParams_plot():
    ham_no_bias = PauliTerm("Z", 0)
    ham_no_bias *= PauliTerm("Z", 1)
    next_term = PauliTerm("Z", 0, -2.0)
    next_term *= PauliTerm("Z", 2)
    ham_no_bias += next_term

    p = 5
    params = ExtendedParams.linear_ramp_from_hamiltonian(ham_no_bias, p)
    fig, ax = plt.subplots()
    params.plot(ax=ax)
    # plt.show()

    p = 8
    params = ExtendedParams((ham_no_bias, p),
                            ([0.1] * p * len(ham_no_bias.get_qubits()), [],
                             [0.2] * p * len(ham_no_bias)))
    fig, ax = plt.subplots()
    params.plot(ax=ax)