Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If there is no quad term, QRAO causes ValueError #35

Closed
Jacomichi opened this issue Dec 14, 2023 · 1 comment
Closed

If there is no quad term, QRAO causes ValueError #35

Jacomichi opened this issue Dec 14, 2023 · 1 comment
Assignees

Comments

@Jacomichi
Copy link
Collaborator

What is problem

When we try to convert Ising Hamiltonian which has only linear term to QRAO Hamiltonian, it gives ValueError
The error message is as below.

ValueError: max() arg is an empty sequence

How to reproduce

ising = IsingModel({}, {0:1.0,1:1.0,2: 5.0, 3: 2.0}, 6.0)
    max_color_group_size = 3
    _, color_group = greedy_graph_coloring(
        ising.quad.keys(), max_color_group_size=max_color_group_size
    )
    color_group = check_linear_term(
        color_group, ising.linear.keys(), max_color_group_size
    )

    qrac_hamiltonian, offset, encoding = jtqp.qrao.qrac31_encode_ising(
        ising, color_group
    )
@Jacomichi Jacomichi self-assigned this Dec 14, 2023
yuyamashiro added a commit that referenced this issue Dec 14, 2023
@Jacomichi
Copy link
Collaborator Author

This issue is fixed at #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant