core.converters.qrao.qrao_space_efficient#
This modeule implements Space efficient Quantum Random Access Optimization (QRAO) [Teramoto et al., 2023]. This method is referred to as Space Compression Ratio Preserving Quantum Relaxation in the paper. With this method, the compression ratio can always be kept at 2.
The Ising Hamiltonian
is converted into a relaxed Hamiltonian as follows:
where \(i\) th variable is mapped into Pauli \(\mu\) operator of the \(k\) th qubit by \(f(i)\).
This Hamiltonian is constructed using the following procedure.
First, divide all the nodes into two groups. Then, assign Pauli \(X\) and \(Y\) to each group. So, \(f(i)\) always provides the Pauli \(X\) or \(Y\) operator on \(k\) th qubit and \(O_{f(i),f(j)}\) becomes \(P_{f(i)} P_{f(j)}\).
On the other hand, if the nodes next to each other on the interaction graph are assigned to the same qubit (\(f(i)\) and \(f(j)\) are assigned to same \(k\) th qubit), \(O_{f(i),f(j)}\) becomes \(Z_k\).
In summary, \(O_{f(i),f(j)}\) becomes as follows:
This module provides functionality to convert optimization problems which written by jijmodeling into relaxed Hamiltonians using above procedure.
The QRACSpaceEfficientConverter class extends the QuantumConverter base class, specializing in Space efficient QRAO-specific operations such as relaxed Hamiltonian generation and result decoding.
- Key Features:
Generation of relaxed Hamiltonians for Space efficient QRAO
Graph coloring algorithm for qubit assignment
Retrieve an encoded Pauli operators list for Pauli Rounding
Decoding of rounding results into classical optimization solutions
Attention
Currently, this module does not provide the rounding algorithm.
Note
This module requires jijmodeling and jijmodeling_transpiler for problem representation and decoding functionalities.
Kosei Teramoto, Rudy Raymond, Eyuri Wakakuwa, and Hiroshi Imai. Quantum-relaxation based optimization algorithms: theoretical extensions. 2023. URL: https://arxiv.org/abs/2302.09481, arXiv:2302.09481.
Classes#
Space efficient QRAO (Quantum Random Access Optimization) converter class. |
Functions#
|
Encodes the Ising model into a space efficient and provides corresponding Pauli operator. |
Module Contents#
- numbering_space_efficient_encode(ising: qamomile.core.ising_qubo.IsingModel) dict[int, qamomile.core.operator.PauliOperator] #
Encodes the Ising model into a space efficient and provides corresponding Pauli operator.
- Parameters:
ising (IsingModel) – The Ising model to be encoded.
- Returns:
A dictionary mapping qubit indices to Pauli operators.
- Return type:
dict[int, qm_o.PauliOperator]
- qrac_space_efficient_encode_ising(ising: qamomile.core.ising_qubo.IsingModel) tuple[qamomile.core.operator.Hamiltonian, dict[int, qamomile.core.operator.PauliOperator]] #
- class QRACSpaceEfficientConverter(compiled_instance, relax_method: jijmodeling_transpiler.core.pubo.RelaxationMethod = jmt.pubo.RelaxationMethod.AugmentedLagrangian, normalize_model: bool = False, normalize_ising: Literal['abs_max', 'rms'] | None = None)#
Bases:
qamomile.core.converters.converter.QuantumConverter
Space efficient QRAO (Quantum Random Access Optimization) converter class.
This class provides methods to convert optimization problems into Space efficient QRAO relaxed Hamiltonians, and decode quantum computation results.
Examples
from qamomile.core.converters.qrao.qrao_space_efficient import QRACSpaceEfficientConverter # Initialize with a compiled optimization problem instance qrao_converter = QRACSpaceEfficientConverter(compiled_instance) # Generate relaxed Hamiltonian cost_hamiltonian = qrao_converter.get_cost_hamiltonian()
Initialize the QuantumConverter.
This method initializes the converter with the compiled instance of the optimization problem
- Parameters:
compiled_instance – The compiled instance of the optimization problem.
relax_method (jmt.pubo.RelaxationMethod) – The relaxation method for PUBO conversion. Defaults to AugmentedLagrangian.
normalize_model (bool) – The objective function and the constraints are normalized using the maximum absolute value of the coefficients contained in each. Defaults to False
normalize_ising (Literal["abs_max", "rms"] | None) – The normalization method for the Ising Hamiltonian. Available options: - “abs_max”: Normalize by absolute maximum value - “rms”: Normalize by root mean square Defaults to None.
- ising_encode(multipliers: dict[str, float] | None = None, detail_parameters: dict[str, dict[tuple[int, Ellipsis], tuple[float, float]]] | None = None) qamomile.core.ising_qubo.IsingModel #
Encode the problem to an Ising model.
This method converts the problem from QUBO (Quadratic Unconstrained Binary Optimization) to Ising model representation.
- Parameters:
multipliers (Optional[dict[str, float]]) – Multipliers for constraint terms.
detail_parameters (Optional[dict[str, dict[tuple[int, ...], tuple[float, float]]]]) – Detailed parameters for the encoding process.
- Returns:
The encoded Ising model.
- Return type:
- get_cost_hamiltonian() qamomile.core.operator.Hamiltonian #
Construct the relaxed Hamiltonian for Space Efficient QRAO.
- Returns:
The relaxed Hamiltonian.
- Return type:
qm_o.Hamiltonian
- get_encoded_pauli_list() list[qamomile.core.operator.Hamiltonian] #
Get the encoded Pauli operators as a list of Hamiltonians.
This method returns the Pauli Operators which correspond to the each variable in the Ising model.
- Returns:
A list of the encoded Pauli operators.
- Return type:
list[qm_o.Hamiltonian]