cosmiq.library#
The algorithm library (see its guide): textbook methods on cosmiq’s programs.
from cosmiq.library import graphs, iqp, mis, reservoir
reg, g = graphs.kings(3, 4, filling=mask, device="cosmiq-ref-1")
res = cq.Emulator().run(mis.program(reg)(), shots=1000, seed=1)
rep = mis.report(mis.postprocess(res, g), g)
F = reservoir.Reservoir(reg, "cosmiq-ref-1", window=4, segment=0.5).features(U)
K = iqp.kernel(X1, X2, feature_map=iqp.zz_map(reg, reps=2))
graphs:Graph, the kings, square and triangular lattices and given positions, refused unless their unit-disk graph is clean (LIB_MARGIN);mis: the sweep, the post-processing, exact answers up to 24 vertices, a report;reservoir: windowed detuning segments, their exact or sampled features, a ridge readout, polynomial baselines and NARMA2;iqp: Qiskit’s IQP and ZZ maps on the register’s CZ graph, their distribution on the digital path’s simulator, and the fidelity kernel. It needs the qiskit extra, and is loaded on first use.
No quantum benefit is claimed for any of them.
|
|
|
|
|
|
|
|
An undirected simple graph on vertices 0..n-1 (vertex i is atom i). |
Submodules
Classes
- class cosmiq.library.Graph(n: int, edges: Iterable[tuple[int, int]] = ())#
Bases:
objectAn undirected simple graph on vertices 0..n-1 (vertex i is atom i).
- degrees() NDArray[int64]#
Each vertex’s number of neighbours.