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_sizeandcount_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.
|
|
How a set of shots did on a graph. |
|
Every maximal independent set enumerated (Bron-Kerbosch with a pivot, on the complement; \(n \le 24\), |
|
The size of a maximum independent set, by exhaustive branching (\(n \le 24\), |
|
Every shot made a maximal independent set, [S, n] uint8. |
|
The sweep, targeted at |
|
|
|
Classes
- class cosmiq.library.mis.Counts(size: int, maximum: int, maximal: int)#
Bases:
objectcount_sets‘ answer: the maximum size, and how many independent sets are maximum and maximal (every maximum set is maximal).
- class cosmiq.library.mis.Report(shots: int, mis_size: int, best_size: int, independent: float, maximal: float, maximum: float, sizes: MappingProxyType)#
Bases:
objectHow 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.
- 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), aShots, or anEmulationResultof one row run withshots=.
- 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 toomega(by default the device’s largest \(\Omega\) on its grid) overramp, \(\Delta\) goes linearly fromdelta_starttodelta_endwhile \(\Omega\) holds, and \(\Omega\) ramps back to 0 with \(\Delta\) atdelta_end.omega,delta_startanddelta_endare 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 sameomegaanddeviceas the program.
- cosmiq.library.mis.report(bits: object, graph: Graph) Report#
bits(raw or post-processed, aspostprocesstakes them) measured against the exact maximum independent set ofgraph(\(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#