cosmiq.library.mis#

cosmiq.library.mis: maximum independent sets on the unit-disk graph of a register, after Pichler et al. 2018 and Ebadi et al. 2022.

  • program: the standard adiabatic sweep, inside cosmiq-ref-1’s limits;

  • postprocess: greedy repair, then greedy fill, so every shot becomes a maximal independent set;

  • exact_size and count_sets: exact answers by exhaustive search, up to 24 vertices;

  • report: how close a set of shots came.

The quality claim covers the default sweep at 4 µs on kings graphs of 8-12 atoms, noise off. Other durations and graphs run, ungraded.

Counts

count_sets' answer: the maximum size, and how many independent sets are maximum and maximal (every maximum set is maximal).

Report

How a set of shots did on a graph.

count_sets

Every maximal independent set enumerated (Bron-Kerbosch with a pivot, on the complement; \(n \le 24\), LIB_SIZE), counted by size.

exact_size

The size of a maximum independent set, by exhaustive branching (\(n \le 24\), LIB_SIZE): a vertex of degree 0 or 1 is always taken, any other is tried both ways.

postprocess

Every shot made a maximal independent set, [S, n] uint8.

program

The sweep, targeted at device: \(\Omega\) ramps from 0 to omega (by default the device's largest \(\Omega\) on its grid) over ramp, \(\Delta\) goes linearly from delta_start to delta_end while \(\Omega\) holds, and \(\Omega\) ramps back to 0 with \(\Delta\) at delta_end.

report

bits (raw or post-processed, as postprocess takes them) measured against the exact maximum independent set of graph (\(n \le 24\), LIB_SIZE).

DELTA_END

DELTA_START

DURATION

LIMIT

RAMP

Classes

class cosmiq.library.mis.Counts(size: int, maximum: int, maximal: int)#

Bases: object

count_sets‘ answer: the maximum size, and how many independent sets are maximum and maximal (every maximum set is maximal).

size: int#
maximum: int#
maximal: int#
property p0: float#

maximum / maximal: the chance a uniformly random maximal independent set is maximum (the baseline the sweep’s quality test compares against).

class cosmiq.library.mis.Report(shots: int, mis_size: int, best_size: int, independent: float, maximal: float, maximum: float, sizes: MappingProxyType)#

Bases: object

How a set of shots did on a graph.

  • shots; mis_size, the exact maximum (exact_size);

  • best_size: the largest independent set among the shots (0 when none is independent);

  • independent, maximal, maximum: the fraction of shots that are independent, maximal and maximum independent sets;

  • sizes: size -> the number of independent shots of that size.

shots: int#
mis_size: int#
best_size: int#
independent: float#
maximal: float#
maximum: float#
sizes: MappingProxyType#

Functions

cosmiq.library.mis.count_sets(graph: Graph) → Counts#

Every maximal independent set enumerated (Bron-Kerbosch with a pivot, on the complement; \(n \le 24\), LIB_SIZE), counted by size.

cosmiq.library.mis.exact_size(graph: Graph) → int#

The size of a maximum independent set, by exhaustive branching (\(n \le 24\), LIB_SIZE): a vertex of degree 0 or 1 is always taken, any other is tried both ways.

cosmiq.library.mis.postprocess(bits: object, graph: Graph) → NDArray[uint8]#

Every shot made a maximal independent set, [S, n] uint8.

  • Repair: while two chosen vertices share an edge, drop the chosen vertex with the most chosen neighbours (the lowest index on a tie).

  • Fill: add each vertex with no chosen neighbour, lowest degree first (then lowest index).

bits: an [S, n] or [n] array of 0, 1 and 2 (lost: not in the set), a Shots, or an EmulationResult of one row run with shots=.

cosmiq.library.mis.program(register: Register, *, device: str | DeviceSpec = 'cosmiq-ref-1', duration: float = DURATION, omega: float | None = None, delta_start: float = DELTA_START, delta_end: float = DELTA_END, ramp: float = RAMP) → AnalogProgram#

The sweep, targeted at device: \(\Omega\) ramps from 0 to omega (by default the device’s largest \(\Omega\) on its grid) over ramp, \(\Delta\) goes linearly from delta_start to delta_end while \(\Omega\) holds, and \(\Omega\) ramps back to 0 with \(\Delta\) at delta_end. omega, delta_start and delta_end are the program’s parameters (“params.omega” and so on). Times are µs and must sit on the device’s clock; the device’s check runs now (ConstraintError).

The register’s margins are checked at this omega (LIB_MARGIN): a graph built at one \(\Omega\) and driven at another, with a pair between \(0.5\,\Omega\) and \(2.5\,\Omega\) at the drive, is refused. Build the graph with the same omega and device as the program.

cosmiq.library.mis.report(bits: object, graph: Graph) → Report#

bits (raw or post-processed, as postprocess takes them) measured against the exact maximum independent set of graph (\(n \le 24\), LIB_SIZE).

Values

cosmiq.library.mis.DELTA_END = 28.274333882308138#
cosmiq.library.mis.DELTA_START = -31.41592653589793#
cosmiq.library.mis.DURATION = 4.0#
cosmiq.library.mis.LIMIT = 24#
cosmiq.library.mis.RAMP = 0.3#