squadds.ml package#

Subpackages#

Submodules#

squadds.ml.client module#

Client of the SQuADDS ML API (the models hosted on the SQuADDS Hugging Face Space).

from squadds.ml import client client.list_models() client.get_model(“transmon_cross_hamiltonian_inverse”) # inputs, outputs, units, limits, example request client.predict(“transmon_cross_hamiltonian_inverse”, inputs={“qubit_frequency_GHz”: 4.85, “anharmonicity_MHz”: -205.0}) client.predict(“<file model id>”, file=”chip.gds”, inputs={“ground_layer”: “1/0”})

The base URL is SQUADDS_ML_API_URL when set, else DEFAULT_URL. Gated models need a Hugging Face token of a member of the SQuADDS organization (token= or HF_TOKEN).

squadds.ml.client.get_model(model_id, base_url=None, token=None, timeout=30)[source]#

One model’s listing entry and contract (GET /v1/models/{model_id}).

Return type:

dict

squadds.ml.client.list_models(base_url=None, token=None, timeout=30)[source]#
Return type:

list[dict]

squadds.ml.client.predict(model_id, inputs=None, file=None, options=None, base_url=None, token=None, timeout=600)[source]#

The response envelope (outputs, metadata, timing_s, cached). file: a path or bytes (file models).

Return type:

dict

Module contents#

Machine-learning models for SQuADDS (optional extra: pip install squadds[ml]).

Submodules import torch / gdstk / numba lazily, so import squadds works without the extra.

squadds.ml.missing_ml_dependencies()[source]#
Return type:

list[str]

squadds.ml.require_ml()[source]#

Raise ImportError naming the missing packages when the [ml] extra is not installed.