Main Content

qubo2ising

Convert QUBO problem to Ising observable

Since R2024b

    Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.

    Description

    o = qubo2ising(qprob) converts the QUBO problem to an equivalent Ising observable.

    example

    Examples

    collapse all

    Create a QUBO problem for the quadratic matrix Q, linear vector c, and constant term d, where

    Q=[0-12-104240]c=[-56-4]d=12.

    Q = [0 -1 2; ...
        -1 0 4; ...
        2 4 0];
    c = [-5 6 -4];
    d = 12;
    qprob = qubo(Q,c,d)
    qprob = 
      qubo with properties:
    
        QuadraticTerm: [3×3 double]
           LinearTerm: [3×1 double]
         ConstantTerm: 12
         NumVariables: 3
    
    

    Convert the QUBO problem to an Ising observable.

    o = qubo2ising(qprob)
    o = 
      observable with properties:
    
           Paulis: [7×1 string]
          Weights: [7×1 double]
        NumQubits: 3
    
    

    Evaluate the QUBO and calculate the expected value of the Ising observable at the point [0;1;0]. The Ising observable is an equivalent representation of the QUBO problem, so the values are the same.

    x = [0;1;0];
    s = quantum.gate.QuantumState("010");
    objective = evaluateObjective(qprob,x)
    objective = 
    18
    
    ev = observe(s,o)
    ev = 
    18
    

    Input Arguments

    collapse all

    QUBO problem, specified as a qubo object or matrix that represents the QUBO problem.

    Output Arguments

    collapse all

    Ising observable, returned as an observable object. The Pauli measurements are a combination of I and Z basis measurements.

    More About

    collapse all

    Ising Problem

    The Ising problem has the same formulation as a QUBO problem but uses a linear transformation that converts the binary variables 0 and 1 to –1 and 1. These values corresponds to the eigenvalues of the Pauli Z measurement operator. For more information, see What Is a QUBO Problem?

    Version History

    Introduced in R2024b

    Go to top of page