Quantum Gate Model

Quantum Approximate Optimization Algorithm

  • Short Name: QAOA
  • Algorithm Type: Hybrid
  • Category: Hybrid-External
  • Native Input Format: QUBO
The Quantum Approximate Optimization Algorithm (QAOA) solves combinatorial optimization problems by approximating the solution.

For a given problem represented as a cost Hamiltonian we formulate two unitary operators. The QAOA solves the problem by iteratively applying the two unitary operators on the cost Hamiltonian for a number of steps p. The angles for the unitary operators are iteratively updated by measuring the state after applying these (like in VQE).

Usage via LunaSolve

# Example of using QAOA using the IQM backend in LunaSolve
solution = ls.solution.create(
    optimization_id=optimization.id,
    solver_name="QAOA",
    provider="aws",
    solver_parameters={
        "aws_provider": "IQM",
        "aws_device": "Garnet",
        "seed": 385920,
        "reps": 1,
        "initial_values": None,
        "shots": 1024,
        "optimizer_params": {
            "method": "COBYLA",
            "bounds": None,
            "tol": None,
            "options": {'maxiter': 20},
        },
    },
    qpu_tokens=TokenProvider(
        aws_access_key=QpuToken(
            source="inline",
            name="<aws_access_key token>",
        ),
        aws_secret_access_key=QpuToken(
            source="inline",
            name="<aws_secret_access_key token>",
        ),
    ),
)

Usage via LunaBench

# Example of adding QAOA using the IQM backend as an algorithm to LunaBench
algorithms = {
    "QAOA": {
        "location": "cloud",
        "provider": "aws",
        # Provide your token (see user guide on QPU tokens for more details)
        "qpu_tokens": {
            "aws_access_key": {
                "source": "inline",
                "token": "<aws_access_key token>",
            },
            "aws_secret_access_key": {
                "source": "inline",
                "token": "<aws_secret_access_key token>",
            },
        },
    },
}

Backends

This algorithm can be run on the following backends:

IQM

IQM, based in Finland, is a leading developer of superconducting quantum computers. Their quantum systems are built using a scalable, high-performance architecture designed to meet the needs of both research and enterprise. IQM’s focus on superconducting qubit technology ensures reliability and precision, making their hardware suitable for a range of quantum applications, including optimization, simulation, and quantum machine learning. With a strong emphasis on innovation and growth, IQM is driving the advancement of quantum computing technologies across Europe and globally.

Read more about IQM here.
Parameters
  • Name
    aws_provider
    Type
    str
    Description

    QPU provider name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    aws_device
    Type
    str
    Description

    QPU device name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    seed
    Type
    int | None
    Description

    Seed for the random number generator.
    Default: 385920

  • Name
    reps
    Type
    int | None
    Description

    The number of repetitions in the QAOA circuit.
    Default: 1

  • Name
    initial_values
    Type
    list[float] | None
    Description

    Initial values for the QAOA parameters.
    Default: None

  • Name
    shots
    Type
    int | None
    Description

    The number of shots to run on the quantum device.
    Default: 1024

  • Name
    optimizer_params
    Type
    OptimizerParams
    Description

    Parameters for the optimizer. Default: None. All possible optimizer parameters can be found in the scipy.optimize.minimize documentation.
    Default: OptimizerParams(method='COBYLA', bounds=None, tol=None, options={'maxiter': 20})

OptimizerParams
  • Name
    method
    Type
    Literal["Nelder-Mead", "Powell", "CG", "BFGS", "L-BFGS-B", "TNC", "COBYLA", "COBYQA", "SLSQP", "trust-constr"]
    Description

    Type of solver. Currently available methods: Nelder-Mead, Powell, CG, BFGS, L-BFGS-B, TNC, COBYLA, COBYQA, SLSQP, trust-constr
    Default: "COBYLA"

  • Name
    bounds
    Type
    list[tuple[float, float]] | None
    Description

    Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell, trust-constr, and COBYLA methods. Sequence of (min, max) pairs for each element in x. None is used to specify no bound.
    Default: None

  • Name
    tol
    Type
    float | None
    Description

    Tolerance for termination. When tol is specified, the selected minimization algorithm sets some relevant solver-specific tolerance(s) equal to tol. For detailed control, use solver-specific options.
    Default: None

  • Name
    options
    Type
    dict[str, Any] | None
    Description

    A dictionary of solver options.
    Default: {'maxiter': 20}

IonQ

IonQ, based in Maryland, USA, is a leader in trapped-ion quantum computing. Their systems use individual atomic ions as qubits, known for their exceptional coherence times and precision control. IonQ’s fully connected qubit architecture enables highly efficient circuit designs and quantum operations, setting them apart with their ability to execute complex algorithms with minimal error. This approach positions IonQ as a top choice for researchers and businesses that require high-fidelity and flexible quantum computation.

Read more about IonQ here.
Parameters
  • Name
    aws_provider
    Type
    str
    Description

    QPU provider name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    aws_device
    Type
    str
    Description

    QPU device name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    seed
    Type
    int | None
    Description

    Seed for the random number generator.
    Default: 385920

  • Name
    reps
    Type
    int | None
    Description

    The number of repetitions in the QAOA circuit.
    Default: 1

  • Name
    initial_values
    Type
    list[float] | None
    Description

    Initial values for the QAOA parameters.
    Default: None

  • Name
    shots
    Type
    int | None
    Description

    The number of shots to run on the quantum device.
    Default: 1024

  • Name
    optimizer_params
    Type
    OptimizerParams
    Description

    Parameters for the optimizer. Default: None. All possible optimizer parameters can be found in the scipy.optimize.minimize documentation.
    Default: OptimizerParams(method='COBYLA', bounds=None, tol=None, options={'maxiter': 20})

OptimizerParams
  • Name
    method
    Type
    Literal["Nelder-Mead", "Powell", "CG", "BFGS", "L-BFGS-B", "TNC", "COBYLA", "COBYQA", "SLSQP", "trust-constr"]
    Description

    Type of solver. Currently available methods: Nelder-Mead, Powell, CG, BFGS, L-BFGS-B, TNC, COBYLA, COBYQA, SLSQP, trust-constr
    Default: "COBYLA"

  • Name
    bounds
    Type
    list[tuple[float, float]] | None
    Description

    Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell, trust-constr, and COBYLA methods. Sequence of (min, max) pairs for each element in x. None is used to specify no bound.
    Default: None

  • Name
    tol
    Type
    float | None
    Description

    Tolerance for termination. When tol is specified, the selected minimization algorithm sets some relevant solver-specific tolerance(s) equal to tol. For detailed control, use solver-specific options.
    Default: None

  • Name
    options
    Type
    dict[str, Any] | None
    Description

    A dictionary of solver options.
    Default: {'maxiter': 20}

Rigetti

Rigetti Computing, based in Berkeley, California, USA, is recognized for its innovations in superconducting quantum processors, designed with a unique gate-based architecture. Rigetti’s hardware features a multi-chip processor setup that enhances scalability and interconnectivity, enabling more complex quantum operations. With a focus on rapid deployment and continuous advancements in superconducting technology, Rigetti stands out in providing high-performance quantum systems for tackling industrial-scale computational challenges.

Read more about Rigetti here.
Parameters
  • Name
    aws_provider
    Type
    str
    Description

    QPU provider name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    aws_device
    Type
    str
    Description

    QPU device name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    seed
    Type
    int | None
    Description

    Seed for the random number generator.
    Default: 385920

  • Name
    reps
    Type
    int | None
    Description

    The number of repetitions in the QAOA circuit.
    Default: 1

  • Name
    initial_values
    Type
    list[float] | None
    Description

    Initial values for the QAOA parameters.
    Default: None

  • Name
    shots
    Type
    int | None
    Description

    The number of shots to run on the quantum device.
    Default: 1024

  • Name
    optimizer_params
    Type
    OptimizerParams
    Description

    Parameters for the optimizer. Default: None. All possible optimizer parameters can be found in the scipy.optimize.minimize documentation.
    Default: OptimizerParams(method='COBYLA', bounds=None, tol=None, options={'maxiter': 20})

OptimizerParams
  • Name
    method
    Type
    Literal["Nelder-Mead", "Powell", "CG", "BFGS", "L-BFGS-B", "TNC", "COBYLA", "COBYQA", "SLSQP", "trust-constr"]
    Description

    Type of solver. Currently available methods: Nelder-Mead, Powell, CG, BFGS, L-BFGS-B, TNC, COBYLA, COBYQA, SLSQP, trust-constr
    Default: "COBYLA"

  • Name
    bounds
    Type
    list[tuple[float, float]] | None
    Description

    Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell, trust-constr, and COBYLA methods. Sequence of (min, max) pairs for each element in x. None is used to specify no bound.
    Default: None

  • Name
    tol
    Type
    float | None
    Description

    Tolerance for termination. When tol is specified, the selected minimization algorithm sets some relevant solver-specific tolerance(s) equal to tol. For detailed control, use solver-specific options.
    Default: None

  • Name
    options
    Type
    dict[str, Any] | None
    Description

    A dictionary of solver options.
    Default: {'maxiter': 20}

QuEra

QuEra Computing, headquartered in Boston, USA, specializes in neutral-atom quantum computing, utilizing arrays of individually controlled atoms as qubits. Their unique architecture leverages Rydberg states for programmable interactions, allowing for versatile algorithm implementations in fields like optimization, simulation, and quantum machine learning. QuEra’s systems are designed with scalability in mind, promising a clear path toward increasingly powerful quantum processors.

Read more about QuEra here.
Parameters
  • Name
    aws_provider
    Type
    str
    Description

    QPU provider name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    aws_device
    Type
    str
    Description

    QPU device name from Amazon Braket. Available providers and devices can be found here.
    Default: None

  • Name
    seed
    Type
    int | None
    Description

    Seed for the random number generator.
    Default: 385920

  • Name
    reps
    Type
    int | None
    Description

    The number of repetitions in the QAOA circuit.
    Default: 1

  • Name
    initial_values
    Type
    list[float] | None
    Description

    Initial values for the QAOA parameters.
    Default: None

  • Name
    shots
    Type
    int | None
    Description

    The number of shots to run on the quantum device.
    Default: 1024

  • Name
    optimizer_params
    Type
    OptimizerParams
    Description

    Parameters for the optimizer. Default: None. All possible optimizer parameters can be found in the scipy.optimize.minimize documentation.
    Default: OptimizerParams(method='COBYLA', bounds=None, tol=None, options={'maxiter': 20})

OptimizerParams
  • Name
    method
    Type
    Literal["Nelder-Mead", "Powell", "CG", "BFGS", "L-BFGS-B", "TNC", "COBYLA", "COBYQA", "SLSQP", "trust-constr"]
    Description

    Type of solver. Currently available methods: Nelder-Mead, Powell, CG, BFGS, L-BFGS-B, TNC, COBYLA, COBYQA, SLSQP, trust-constr
    Default: "COBYLA"

  • Name
    bounds
    Type
    list[tuple[float, float]] | None
    Description

    Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell, trust-constr, and COBYLA methods. Sequence of (min, max) pairs for each element in x. None is used to specify no bound.
    Default: None

  • Name
    tol
    Type
    float | None
    Description

    Tolerance for termination. When tol is specified, the selected minimization algorithm sets some relevant solver-specific tolerance(s) equal to tol. For detailed control, use solver-specific options.
    Default: None

  • Name
    options
    Type
    dict[str, Any] | None
    Description

    A dictionary of solver options.
    Default: {'maxiter': 20}

IBM

Quantum Approximate Optimization Algorithm temporarily unavailable on IBM
IBM, headquartered in New York, USA, is a global leader in quantum computing, offering robust and scalable gate-based quantum hardware utilizing superconducting qubit technology. Known for their innovation, IBM’s quantum systems support a broad range of applications and feature one of the most mature quantum ecosystems in the industry. Their strong integration with classical computing resources and their continuous advancements in quantum research make IBM a trusted choice for enterprises and researchers exploring scalable quantum solutions worldwide.

Read more about IBM Quantum here.
Parameters
  • Name
    backend
    Type
    Simulator | FakeProvider | IbmBackend | LeastBusy
    Description

    Which backend to use. If None, will use no backend and StatevectorSampler and StatevectorEstimator. If dict, will call runtime_service.least_busy with the params given in the dict. If str: If 'AerSimulator', use AerSimulator. If string starts with 'Fake', will use the corresponding fake backend from qiskit_ibm_runtime.fake_provider. Otherwise, will try to use a real backend with this name.
    Default: Simulator(backend_type='simulator', backend_name='aer')

  • Name
    shots
    Type
    int
    Description

    Shots for the optimizer
    Default: 1024

  • Name
    dynamical_decoupling
    Type
    dict[str, Any]
    Description

    Dynamical decoupling options for the optimizer
    Default: {}

  • Name
    optimizer
    Type
    str
    Description

    Name of the optimizer to use in scipy minimize
    Default: "COBYLA"

  • Name
    maxiter
    Type
    int
    Description

    Maximum number of iterations for the algorithm
    Default: 1

  • Name
    optimization_level
    Type
    int
    Description

    Optimization level for the pass manager
    Default: 2

  • Name
    service_config
    Type
    ServiceConfig
    Description

    Parameters to be passed to the QiskitRuntimeService object
    Default: ServiceConfig(channel='ibm_quantum', url=None, name=None, instance=None, proxies=None, verify=None, channel_strategy=None)

  • Name
    qaoa_config
    Type
    QaoaConfig
    Description

    Configuration for the QAOAAnsatz
    Default: QaoaConfig(reps=1, name='QAOA')

Simulator
  • Name
    backend_type
    Type
    Literal["simulator"]
    Description

    None
    Default: "simulator"

  • Name
    backend_name
    Type
    Literal["aer", "statevector"]
    Description

    Which simulator to use. Currently, AerSimulator from qiskit_aer and the statevector simulator from qiskit.primitives are available.
    Default: "aer"

FakeProvider
  • Name
    backend_type
    Type
    Literal["fake_provider"]
    Description

    None
    Default: "fake_provider"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use

IbmBackend
  • Name
    backend_type
    Type
    Literal["ibm_backend"]
    Description

    None
    Default: "ibm_backend"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use.

LeastBusy
  • Name
    backend_type
    Type
    Literal["least_busy"]
    Description

    None
    Default: "least_busy"

  • Name
    query_params
    Type
    LeastBusyQuery
    Description

    Parameters to use when querying the least busy backend.
    Default: LeastBusyQuery(min_num_qubits=None, instance=None, filters={})

ServiceConfig
  • Name
    channel
    Type
    Literal["ibm_cloud", "ibm_quantum"] | None
    Description

    The channel type for the service
    Default: "ibm_quantum"

  • Name
    url
    Type
    str | None
    Description

    The URL of the service
    Default: None

  • Name
    name
    Type
    str | None
    Description

    The name of the service
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    The instance identifier
    Default: None

  • Name
    proxies
    Type
    dict | None
    Description

    Proxy settings for the service
    Default: None

  • Name
    verify
    Type
    bool | None
    Description

    SSL verification setting
    Default: None

  • Name
    channel_strategy
    Type
    str | None
    Description

    The strategy for the channel
    Default: None

QaoaConfig
  • Name
    reps
    Type
    int
    Description

    Depth of the circuit
    Default: 1

  • Name
    name
    Type
    str
    Description

    Name of the circuit
    Default: "QAOA"

LeastBusyQuery
  • Name
    min_num_qubits
    Type
    int | None
    Description

    Minimum number of qubits the backend has to have.
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    This is only supported for ibm_quantum runtime and is in the hub/group/project format.
    Default: None

  • Name
    filters
    Type
    dict[str, Any]
    Description

    Simple filters that require a specific value for an attribute in backend configuration or status. Example: {'operational': True}
    Default: {}

IBM Simulator

IBM, headquartered in New York, USA, is a global leader in quantum computing, offering robust and scalable gate-based quantum hardware utilizing superconducting qubit technology. Known for their innovation, IBM’s quantum systems support a broad range of applications and feature one of the most mature quantum ecosystems in the industry. Their strong integration with classical computing resources and their continuous advancements in quantum research make IBM a trusted choice for enterprises and researchers exploring scalable quantum solutions worldwide.

Read more about IBM Quantum here.
Parameters
  • Name
    backend
    Type
    Simulator | FakeProvider | IbmBackend | LeastBusy
    Description

    Which backend to use. If None, will use no backend and StatevectorSampler and StatevectorEstimator. If dict, will call runtime_service.least_busy with the params given in the dict. If str: If 'AerSimulator', use AerSimulator. If string starts with 'Fake', will use the corresponding fake backend from qiskit_ibm_runtime.fake_provider. Otherwise, will try to use a real backend with this name.
    Default: Simulator(backend_type='simulator', backend_name='aer')

  • Name
    shots
    Type
    int
    Description

    Shots for the optimizer
    Default: 1024

  • Name
    dynamical_decoupling
    Type
    dict[str, Any]
    Description

    Dynamical decoupling options for the optimizer
    Default: {}

  • Name
    optimizer
    Type
    str
    Description

    Name of the optimizer to use in scipy minimize
    Default: "COBYLA"

  • Name
    maxiter
    Type
    int
    Description

    Maximum number of iterations for the algorithm
    Default: 1

  • Name
    optimization_level
    Type
    int
    Description

    Optimization level for the pass manager
    Default: 2

  • Name
    service_config
    Type
    ServiceConfig
    Description

    Parameters to be passed to the QiskitRuntimeService object
    Default: ServiceConfig(channel='ibm_quantum', url=None, name=None, instance=None, proxies=None, verify=None, channel_strategy=None)

  • Name
    qaoa_config
    Type
    QaoaConfig
    Description

    Configuration for the QAOAAnsatz
    Default: QaoaConfig(reps=1, name='QAOA')

Simulator
  • Name
    backend_type
    Type
    Literal["simulator"]
    Description

    None
    Default: "simulator"

  • Name
    backend_name
    Type
    Literal["aer", "statevector"]
    Description

    Which simulator to use. Currently, AerSimulator from qiskit_aer and the statevector simulator from qiskit.primitives are available.
    Default: "aer"

FakeProvider
  • Name
    backend_type
    Type
    Literal["fake_provider"]
    Description

    None
    Default: "fake_provider"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use

IbmBackend
  • Name
    backend_type
    Type
    Literal["ibm_backend"]
    Description

    None
    Default: "ibm_backend"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use.

LeastBusy
  • Name
    backend_type
    Type
    Literal["least_busy"]
    Description

    None
    Default: "least_busy"

  • Name
    query_params
    Type
    LeastBusyQuery
    Description

    Parameters to use when querying the least busy backend.
    Default: LeastBusyQuery(min_num_qubits=None, instance=None, filters={})

ServiceConfig
  • Name
    channel
    Type
    Literal["ibm_cloud", "ibm_quantum"] | None
    Description

    The channel type for the service
    Default: "ibm_quantum"

  • Name
    url
    Type
    str | None
    Description

    The URL of the service
    Default: None

  • Name
    name
    Type
    str | None
    Description

    The name of the service
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    The instance identifier
    Default: None

  • Name
    proxies
    Type
    dict | None
    Description

    Proxy settings for the service
    Default: None

  • Name
    verify
    Type
    bool | None
    Description

    SSL verification setting
    Default: None

  • Name
    channel_strategy
    Type
    str | None
    Description

    The strategy for the channel
    Default: None

QaoaConfig
  • Name
    reps
    Type
    int
    Description

    Depth of the circuit
    Default: 1

  • Name
    name
    Type
    str
    Description

    Name of the circuit
    Default: "QAOA"

LeastBusyQuery
  • Name
    min_num_qubits
    Type
    int | None
    Description

    Minimum number of qubits the backend has to have.
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    This is only supported for ibm_quantum runtime and is in the hub/group/project format.
    Default: None

  • Name
    filters
    Type
    dict[str, Any]
    Description

    Simple filters that require a specific value for an attribute in backend configuration or status. Example: {'operational': True}
    Default: {}

Fire Opal Quantum Approximate Optimization Algorithm

  • Short Name: QAOA_FO
  • Algorithm Type: Hybrid
  • Category: Hybrid-External
  • Native Input Format: QUBO
QAOA is a popular algorithm that can be applied to a wide range of optimization problems that are out of reach today like portfolio optimization, efficient logistics routing, and asset liability management.

This version of QAOA is from Q-CTRL’s software framework “Fire Opal”. When running QAOA via Fire Opal, all aspects of running QAOA on real hardware are fully optimized to reduce errors and improve the quality of solutions. By tailoring all parts of the algorithm to be hardware-optimized, Fire Opal enables larger problems to converge on the correct solution and do so in fewer iterations, reducing the required execution time.

Using Luna, it is possible to run QAOA using Fire Opal on IBM’s hardware.

For further information, see Q-CTRL’s documentation.

Usage via LunaSolve

# Example of using QAOA_FO using the IBM backend in LunaSolve
solution = ls.solution.create(
    optimization_id=optimization.id,
    solver_name="QAOA_FO",
    provider="qctrl",
    solver_parameters={
        "organization_slug": None,
        "backend_name": "ibm_kyiv",
        "hub": "ibm-q",
        "group": "open",
        "project": "main",
    },
    qpu_tokens=TokenProvider(
        qctrl=QpuToken(
            source="inline",
            name="<qctrl token>",
        ),
        ibm=QpuToken(
            source="inline",
            name="<ibm token>",
        ),
    ),
)

Usage via LunaBench

# Example of adding QAOA_FO using the IBM backend as an algorithm to LunaBench
algorithms = {
    "QAOA_FO": {
        "location": "cloud",
        "provider": "qctrl",
        # Provide your token (see user guide on QPU tokens for more details)
        "qpu_tokens": {
            "qctrl": {
                "source": "inline",
                "token": "<qctrl token>",
            },
            "ibm": {
                "source": "inline",
                "token": "<ibm token>",
            },
        },
    },
}

Backends

This algorithm can be run on the following backends:

IBM

IBM, headquartered in New York, USA, is a global leader in quantum computing, offering robust and scalable gate-based quantum hardware utilizing superconducting qubit technology. Known for their innovation, IBM’s quantum systems support a broad range of applications and feature one of the most mature quantum ecosystems in the industry. Their strong integration with classical computing resources and their continuous advancements in quantum research make IBM a trusted choice for enterprises and researchers exploring scalable quantum solutions worldwide.

Read more about IBM Quantum here.
Parameters
  • Name
    organization_slug
    Type
    Any
    Description

    Organization slug from the organization of the user. Required, if the user is part of more than one organization. This information can be retrieved from your Q-CTRL account.
    Default: None

  • Name
    backend_name
    Type
    str | None
    Description

    Defines backend simulator for the algorithm. To see, which backends are available, please check your ibm account. It usually starts with 'ibm_', e.g., 'ibm_osaka'. 'least_busy' is also allowed. In this case, the least busy solver will be used.
    Default: None

  • Name
    hub
    Type
    str
    Description

    The IBM Quantum hub.
    Default: "ibm-q"

  • Name
    group
    Type
    str
    Description

    The IBM Quantum group.
    Default: "open"

  • Name
    project
    Type
    str
    Description

    The IBM Quantum project.
    Default: "main"

Variational Quantum Eigensolver

  • Short Name: VQE
  • Algorithm Type: Hybrid
  • Category: Hybrid-Internal
  • Native Input Format: AqModel
The Variational Quantum Eigensolver (VQE) solves combinatorial optimization problems by approximating the solution.

For a given problem represented as a cost Hamiltonian we apply a classical/quantum hybrid algorithm to find the solution. The VQE solves the problem by iteratively applying a linear transformation (variational form) on the cost Hamiltonian and optimizing the parameters of the transformation using a classical optimizer.

For further information see qiskit’s VQE tutorial.

Usage via LunaSolve

# Example of using VQE using the IBM backend in LunaSolve
solution = ls.solution.create(
    optimization_id=optimization.id,
    solver_name="VQE",
    provider="ibm",
    solver_parameters={
        "backend": {
            "backend_type": "ibm_backend",
            "backend_name": "ibm_kyiv",
        },
        "shots": 1024,
        "dynamical_decoupling": {},
        "optimizer": "COBYLA",
        "maxiter": 1,
        "optimization_level": 2,
        "service_config": {
            "channel": "ibm_quantum",
            "url": None,
            "name": None,
            "instance": None,
            "proxies": None,
            "verify": None,
            "channel_strategy": None,
        },
        "ansatz": "EfficientSU2",
        "ansatz_config": {},
    },
    qpu_tokens=TokenProvider(
        ibm=QpuToken(
            source="inline",
            name="<ibm token>",
        ),
    ),
)

Usage via LunaBench

# Example of adding VQE using the IBM backend as an algorithm to LunaBench
algorithms = {
    "VQE": {
        "location": "cloud",
        "provider": "ibm",
        # Provide your token (see user guide on QPU tokens for more details)
        "qpu_tokens": {
            "ibm": {
                "source": "inline",
                "token": "<ibm token>",
            },
        },
    },
}

Backends

This algorithm can be run on the following backends:

IBM

Variational Quantum Eigensolver temporarily unavailable on IBM
IBM, headquartered in New York, USA, is a global leader in quantum computing, offering robust and scalable gate-based quantum hardware utilizing superconducting qubit technology. Known for their innovation, IBM’s quantum systems support a broad range of applications and feature one of the most mature quantum ecosystems in the industry. Their strong integration with classical computing resources and their continuous advancements in quantum research make IBM a trusted choice for enterprises and researchers exploring scalable quantum solutions worldwide.

Read more about IBM Quantum here.
Parameters
  • Name
    backend
    Type
    Simulator | FakeProvider | IbmBackend | LeastBusy
    Description

    Which backend to use. If None, will use no backend and StatevectorSampler and StatevectorEstimator. If dict, will call runtime_service.least_busy with the params given in the dict. If str: If 'AerSimulator', use AerSimulator. If string starts with 'Fake', will use the corresponding fake backend from qiskit_ibm_runtime.fake_provider. Otherwise, will try to use a real backend with this name.
    Default: Simulator(backend_type='simulator', backend_name='aer')

  • Name
    shots
    Type
    int
    Description

    Shots for the optimizer
    Default: 1024

  • Name
    dynamical_decoupling
    Type
    dict[str, Any]
    Description

    Dynamical decoupling options for the optimizer
    Default: {}

  • Name
    optimizer
    Type
    str
    Description

    Name of the optimizer to use in scipy minimize
    Default: "COBYLA"

  • Name
    maxiter
    Type
    int
    Description

    Maximum number of iterations for the algorithm
    Default: 1

  • Name
    optimization_level
    Type
    int
    Description

    Optimization level for the pass manager
    Default: 2

  • Name
    service_config
    Type
    ServiceConfig
    Description

    Parameters to be passed to the QiskitRuntimeService object
    Default: ServiceConfig(channel='ibm_quantum', url=None, name=None, instance=None, proxies=None, verify=None, channel_strategy=None)

  • Name
    ansatz
    Type
    str
    Description

    Which ansatz to use from qiskit.circuit.library
    Default: "EfficientSU2"

  • Name
    ansatz_config
    Type
    dict[str, Any]
    Description

    Configuration for the ansatz
    Default: {}

Simulator
  • Name
    backend_type
    Type
    Literal["simulator"]
    Description

    None
    Default: "simulator"

  • Name
    backend_name
    Type
    Literal["aer", "statevector"]
    Description

    Which simulator to use. Currently, AerSimulator from qiskit_aer and the statevector simulator from qiskit.primitives are available.
    Default: "aer"

FakeProvider
  • Name
    backend_type
    Type
    Literal["fake_provider"]
    Description

    None
    Default: "fake_provider"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use

IbmBackend
  • Name
    backend_type
    Type
    Literal["ibm_backend"]
    Description

    None
    Default: "ibm_backend"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use.

LeastBusy
  • Name
    backend_type
    Type
    Literal["least_busy"]
    Description

    None
    Default: "least_busy"

  • Name
    query_params
    Type
    LeastBusyQuery
    Description

    Parameters to use when querying the least busy backend.
    Default: LeastBusyQuery(min_num_qubits=None, instance=None, filters={})

ServiceConfig
  • Name
    channel
    Type
    Literal["ibm_cloud", "ibm_quantum"] | None
    Description

    The channel type for the service
    Default: "ibm_quantum"

  • Name
    url
    Type
    str | None
    Description

    The URL of the service
    Default: None

  • Name
    name
    Type
    str | None
    Description

    The name of the service
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    The instance identifier
    Default: None

  • Name
    proxies
    Type
    dict | None
    Description

    Proxy settings for the service
    Default: None

  • Name
    verify
    Type
    bool | None
    Description

    SSL verification setting
    Default: None

  • Name
    channel_strategy
    Type
    str | None
    Description

    The strategy for the channel
    Default: None

LeastBusyQuery
  • Name
    min_num_qubits
    Type
    int | None
    Description

    Minimum number of qubits the backend has to have.
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    This is only supported for ibm_quantum runtime and is in the hub/group/project format.
    Default: None

  • Name
    filters
    Type
    dict[str, Any]
    Description

    Simple filters that require a specific value for an attribute in backend configuration or status. Example: {'operational': True}
    Default: {}

IBM Simulator

IBM, headquartered in New York, USA, is a global leader in quantum computing, offering robust and scalable gate-based quantum hardware utilizing superconducting qubit technology. Known for their innovation, IBM’s quantum systems support a broad range of applications and feature one of the most mature quantum ecosystems in the industry. Their strong integration with classical computing resources and their continuous advancements in quantum research make IBM a trusted choice for enterprises and researchers exploring scalable quantum solutions worldwide.

Read more about IBM Quantum here.
Parameters
  • Name
    backend
    Type
    Simulator | FakeProvider | IbmBackend | LeastBusy
    Description

    Which backend to use. If None, will use no backend and StatevectorSampler and StatevectorEstimator. If dict, will call runtime_service.least_busy with the params given in the dict. If str: If 'AerSimulator', use AerSimulator. If string starts with 'Fake', will use the corresponding fake backend from qiskit_ibm_runtime.fake_provider. Otherwise, will try to use a real backend with this name.
    Default: Simulator(backend_type='simulator', backend_name='aer')

  • Name
    shots
    Type
    int
    Description

    Shots for the optimizer
    Default: 1024

  • Name
    dynamical_decoupling
    Type
    dict[str, Any]
    Description

    Dynamical decoupling options for the optimizer
    Default: {}

  • Name
    optimizer
    Type
    str
    Description

    Name of the optimizer to use in scipy minimize
    Default: "COBYLA"

  • Name
    maxiter
    Type
    int
    Description

    Maximum number of iterations for the algorithm
    Default: 1

  • Name
    optimization_level
    Type
    int
    Description

    Optimization level for the pass manager
    Default: 2

  • Name
    service_config
    Type
    ServiceConfig
    Description

    Parameters to be passed to the QiskitRuntimeService object
    Default: ServiceConfig(channel='ibm_quantum', url=None, name=None, instance=None, proxies=None, verify=None, channel_strategy=None)

  • Name
    ansatz
    Type
    str
    Description

    Which ansatz to use from qiskit.circuit.library
    Default: "EfficientSU2"

  • Name
    ansatz_config
    Type
    dict[str, Any]
    Description

    Configuration for the ansatz
    Default: {}

Simulator
  • Name
    backend_type
    Type
    Literal["simulator"]
    Description

    None
    Default: "simulator"

  • Name
    backend_name
    Type
    Literal["aer", "statevector"]
    Description

    Which simulator to use. Currently, AerSimulator from qiskit_aer and the statevector simulator from qiskit.primitives are available.
    Default: "aer"

FakeProvider
  • Name
    backend_type
    Type
    Literal["fake_provider"]
    Description

    None
    Default: "fake_provider"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use

IbmBackend
  • Name
    backend_type
    Type
    Literal["ibm_backend"]
    Description

    None
    Default: "ibm_backend"

  • Name
    backend_name
    Type
    str
    Description

    Which backend to use.

LeastBusy
  • Name
    backend_type
    Type
    Literal["least_busy"]
    Description

    None
    Default: "least_busy"

  • Name
    query_params
    Type
    LeastBusyQuery
    Description

    Parameters to use when querying the least busy backend.
    Default: LeastBusyQuery(min_num_qubits=None, instance=None, filters={})

ServiceConfig
  • Name
    channel
    Type
    Literal["ibm_cloud", "ibm_quantum"] | None
    Description

    The channel type for the service
    Default: "ibm_quantum"

  • Name
    url
    Type
    str | None
    Description

    The URL of the service
    Default: None

  • Name
    name
    Type
    str | None
    Description

    The name of the service
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    The instance identifier
    Default: None

  • Name
    proxies
    Type
    dict | None
    Description

    Proxy settings for the service
    Default: None

  • Name
    verify
    Type
    bool | None
    Description

    SSL verification setting
    Default: None

  • Name
    channel_strategy
    Type
    str | None
    Description

    The strategy for the channel
    Default: None

LeastBusyQuery
  • Name
    min_num_qubits
    Type
    int | None
    Description

    Minimum number of qubits the backend has to have.
    Default: None

  • Name
    instance
    Type
    str | None
    Description

    This is only supported for ibm_quantum runtime and is in the hub/group/project format.
    Default: None

  • Name
    filters
    Type
    dict[str, Any]
    Description

    Simple filters that require a specific value for an attribute in backend configuration or status. Example: {'operational': True}
    Default: {}

Was this page helpful?