udm#

Unit Disk Mapping (UDM) module for Qamomile.

This module implements algorithms for mapping various optimization problems (like QUBO and Ising models) to unit disk grid graphs, which can be naturally encoded in neutral-atom quantum computers.

Submodules#

Classes#

QUBOResult

Result of mapping a QUBO problem to a unit disk graph.

Ising_UnitDiskGraph

A representation of an Ising model as a unit disk graph suitable for neutral atom quantum computers.

UDMTranspiler

Transpiler to convert raw bitstring-count results from a quantum SDK

Package Contents#

class QUBOResult(grid_graph, pins, mis_overhead)#

Result of mapping a QUBO problem to a unit disk graph.

grid_graph#
pins#
mis_overhead#
qubo_grid_to_locations(scale=5.0) list[tuple[float, float]]#

Convert a QUBO grid graph to a list of tuples, each represent the node location. :param qubo_result: QUBOResult object from map_qubo

Returns:

List of (x, y) tuples

qubo_result_to_weights() list[float]#

Convert a QUBOResult to a list of weights for each node.

Parameters:

qubo_result – QUBOResult object from map_qubo

Returns:

List of weights for each node in the grid graph.

class Ising_UnitDiskGraph#

A representation of an Ising model as a unit disk graph suitable for neutral atom quantum computers.

This class wraps the UDM module to map QUBO/Ising problems to unit disk graphs.

ising_model: qamomile.core.ising_qubo.IsingModel#
property qubo_result: QUBOResult#

Get the QUBOResult object from the UDM module.

property networkx_graph: object#

Get the NetworkX graph representation.

property pins: list#

Get the list of pins (indices of nodes corresponding to original variables).

property nodes: list#

Get the list of nodes in the unit disk graph.

property delta: float#

Get the delta parameter used for scaling the weights.

class UDMTranspiler(udg: udm.mwis_solver.Ising_UnitDiskGraph, num_vars: int)#

Bases: qamomile.core.transpiler.QuantumSDKTranspiler[collections.OrderedDict]

Transpiler to convert raw bitstring-count results from a quantum SDK into jijmodeling Solutions by mapping through the unit-disk-graph.

Parameters:
  • udg – An Ising_UnitDiskGraph instance containing the QUBO mapping.

  • jm_vars – Ordered list of jijmodeling.BinaryVar corresponding to the original problem variables.

udg#
num_vars#
convert_result(result: collections.OrderedDict) qamomile.core.bitssample.BitsSampleSet#

Convert the SDK-specific bitstring->count result into a list of jijmodeling Solution objects.

Steps: 1. Parse each bitstring into a list of ints (0/1). 2. Map through the QUBOResult using map_config_back to recover

the original binary assignments.

  1. Build a jijmodeling Solution with the variable assignments and the measurement count as weight.

transpile_circuit(circuit: qamomile.core.circuit.QuantumCircuit)#

No circuit-level changes needed; return the original circuit.

transpile_hamiltonian(operator: qamomile.core.operator.Hamiltonian)#

No Hamiltonian-level changes needed; return the original operator.