hugr

Client API for HUGR in Nexus.

N.B. Nexus support for HUGR is experimental, and any HUGRs programs uploaded to Nexus before stability is achieved might not work in the future.

qnexus.client.hugr.cost(
programs: HUGRRef | list[HUGRRef],
n_shots: int | list[int],
project: ProjectRef | None = None,
system_name: Literal['Helios-1'] = 'Helios-1',
) float[source]

Estimate the cost (in HQC) of running Hugr programs for n_shots number of shots on a Quantinuum Helios system.

NB: This will execute a costing job on a dedicated cost estimation device.

Once run, the cost will be visible also in the Nexus web portal as part of the job.

qnexus.client.hugr.get(
*,
id: UUID | str | None = None,
name_like: str | None = None,
creator_email: list[str] | None = None,
project: ProjectRef | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
created_before: datetime | None = None,
created_after: datetime | None = datetime.datetime(2023, 1, 1, 0, 0),
modified_before: datetime | None = None,
modified_after: datetime | None = None,
sort_filters: list[SortFilterEnum] | None = None,
page_number: int | None = None,
page_size: int | None = None,
scope: ScopeFilterEnum = ScopeFilterEnum.USER,
) HUGRRef[source]

Get a single HUGR using filters. Throws an exception if the filters do not match exactly one object.

qnexus.client.hugr.get_all(
name_like: str | None = None,
creator_email: list[str] | None = None,
project: ProjectRef | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
created_before: datetime | None = None,
created_after: datetime | None = datetime.datetime(2023, 1, 1, 0, 0),
modified_before: datetime | None = None,
modified_after: datetime | None = None,
sort_filters: list[SortFilterEnum] | None = None,
page_number: int | None = None,
page_size: int | None = None,
scope: ScopeFilterEnum = ScopeFilterEnum.USER,
) NexusIterator[HUGRRef][source]

Get a NexusIterator over HUGRs with optional filters.

qnexus.client.hugr.update(
ref: HUGRRef,
name: str | None = None,
description: str | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
) HUGRRef[source]

Update the annotations on a HUGRRef.

qnexus.client.hugr.upload(
hugr_package: Package | PackagePointer | Hugr[Module],
name: str,
project: ProjectRef | None = None,
description: str | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
) HUGRRef[source]

Upload a HUGR to Nexus.

N.B. HUGR support in Nexus is subject to change. Until full support is achieved any programs uploaded may not work in the future.

class qnexus.hugr.HUGRRef(
*,
id: UUID,
annotations: Annotations,
project: ProjectRef,
type: Literal['HUGRRef'] = 'HUGRRef',
)[source]

Proxy object to a HUGR in Nexus.

df() DataFrame[source]

Present in a pandas DataFrame.

download_hugr() Package[source]

Get the HUGR Package of the original uploaded HUGR.

download_hugr_bytes() bytes[source]

Get the HUGR bytes of the original uploaded HUGR.