Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Qamomile v0.12.5

Qamomile v0.12.5 adds Pauli Correlation Encoding (PCE) through PCEConverter and PCEEncoder, so quadratic optimization workflows can encode spin variables as k-body Pauli correlators and can reduce qubit counts compared with one-qubit-per-spin encodings. QURI Parts sampling can now be seeded for reproducible tutorials and benchmarks. This release also fixes issues around controlled gates, measurement-dependent conditions, and expectation values for Vector elements.

pip install qamomile==0.12.5

New Features

Pauli Correlation Encoding (PCE)

Use PCEConverter to apply Pauli Correlation Encoding to quadratic QUBO/Ising optimization problems supplied as either an ommx.v1.Instance or a Qamomile BinaryModel. PCE encodes each spin variable as a distinct k-body Pauli correlator. This can reduce the required qubit count compared with assigning one qubit to each spin variable. When num_qubits is omitted, the converter uses the smallest n >= k satisfying C(n, k) * 3**k >= num_variables. The assigned observables are available through get_encoded_pauli_list(), and correlator expectation values can be decoded with decode(...) (#369).

from qamomile.optimization.binary_model import BinaryModel
from qamomile.optimization.pce import PCEConverter

ising = BinaryModel.from_ising(
    linear={0: 1.0, 1: -1.0, 2: 0.5},
    quad={(0, 1): 2.0},
    constant=0.0,
)
converter = PCEConverter(ising, correlator_order=2)
observables = converter.get_encoded_pauli_list()
sampleset = converter.decode([0.8, -0.4, 0.2])
print(converter.num_qubits, len(observables))
print(sampleset.samples, sampleset.energy)
2 3
[{0: 1, 1: -1, 2: 1}] [0.5]

See Pauli Correlation Encoding (PCE) for the full workflow.

Reproducible QURI Parts sampling

With the default Qulacs-based sampler, QuriPartsExecutor(seed=...) and QuriPartsTranspiler().executor(seed=...) can now fix the random seed. Two executors built with the same seed and sampled on the same circuit return identical shot counts, while omitting the seed keeps the previous non-deterministic behavior (#441).

from qamomile.quri_parts import QuriPartsTranspiler

transpiler = QuriPartsTranspiler()
executor = transpiler.executor(seed=42)

Bug Fixes

Documentation

Learn More