Hamiltonian to QUBO conversion and vice versa

I have a Hamiltonian. How can I transform the Hamiltonian to QUBO? Is there any other way of doing the reverse(QUBO to hamiltonian)?



  • Is your Hamiltonian in Ising form? If so, you can submit it directly to the QPU with the sample_ising() function in Ocean. 

    If not, can you give more information about the format of your Hamiltonian?


    Comment actions Permalink
  • this is my hamiltonian. Solving with this with Numpy or analytically gives the minimum eigen value of -2, which is correct. Solving this with a gate model VQE algorithm also gives -2. how can i solve(find the minimum energy) this in DWAVE machine? 

    * This hamiltonian is a 2 qubit hamiltonian (4x4 matrix). What will the the dimension of QUBO matrix of this hamiltonian?

    * Is it possible to transform every hamitonian to QUBO and vice versa? If possible please elaborate the mathematical steps.

    Thanks in advance

    Comment actions Permalink
  • I have had good luck with converting Hamiltonians to Ising and QUBO forms using PyQUBO., where the Hamiltonian is in the form of a mathematical expression. The open source project is on Github at: https://github.com/recruit-communications/pyqubo .

    Comment actions Permalink
  • As per my knowledge if a hamiltonian is in Ising format it can be transformed in QUBO and vice versa using this PyQUBO. How can i be sure that the hamiltonian i mentioned above is an "Ising hamiltonian"?

      Operator decomposition of the above hamiltonian follows                  

    H = 0.5XX + 0.5YY + 0.5ZZ - 0.5II
    Where X,Y,Z are pauli matrices and I is the Identity matrix
    • If it is not an Ising hamiltonian then is it possible to transform the hamiltonian into an Ising hamiltonian?
    • How to transform a hamiltonian to Ising hamiltonian?
    Comment actions Permalink
  • Hello,

    I have discussed this with my colleagues and have collected some information for you.

    When people talk about converting between Ising and QUBO they are talking about a classical Ising Hamiltonian. 

    This transformation is by a simple change of variables.

    The quantum Hamiltonian we work with is a transverse field Ising model with 1- and 2-body Z terms and 1-body X terms. 

    At the end of the anneal (s=1) the transverse field (and therefore the X-basis terms) goes to zero, and we have a classical Ising Hamiltonian that can be translated into QUBO. 

    In light of this, we can see that the idea of translating to QUBO in the middle of the anneal doesn't make sense.

    The 2-qubit Hamiltonian you show is a quantum Hamiltonian acting on a 2-qubit Hilbert space. 

    A 2-qubit classical Ising Hamiltonian is in 2 dimensions rather than 4, and has the form H(x) = x' J x + h' x. 

    This can be translated into QUBO form with the affine transformation y = (x+1)/2, with a cost function C(y) = y' Q y.

    For quantum Hamiltonians, some but not all can be expressed as a transverse field Ising model. 

    For example, the 4x4 matrix you shared cannot be expressed in the given basis because the off-diagonal entries do not correspond to a uniform transverse field.

    I hope this proves to be helpful!

    Comment actions Permalink
  • Thank you David J for your attention. This is the answer i was looking for.

    Comment actions Permalink
  • Great! Glad we could be of assistance!
    Feel free to reach out with any other questions you might have.

    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post