general_superstaq.compiler_output

Attributes

C

Q

Classes

BaseCompilerOutput

A base class that stores the results of compiled circuits.

CompilerOutput

A class that arranges compiled circuit information.

Functions

read_json_jaqal(→ CompilerOutput)

Reads out the returned JSON from Superstaq API's Jaqal compilation endpoint.

Module Contents

class general_superstaq.compiler_output.BaseCompilerOutput(circuits: C | list[C] | list[list[C]], initial_logical_to_physicals: dict[Q, Q] | list[dict[Q, Q]] | list[list[dict[Q, Q]]], final_logical_to_physicals: dict[Q, Q] | list[dict[Q, Q]] | list[list[dict[Q, Q]]], pulse_gate_circuits: Any | None = None, seq: Any | None = None, jaqal_programs: list[str] | None = None)

Bases: Generic[C, Q]

A base class that stores the results of compiled circuits.

has_multiple_circuits() bool

Checks if this object has plural attributes (e.g. .circuits).

Otherwise, the object represents a single circuit, and has singular attributes (.circuit).

Returns:

A boolean indicating whether this object represents multiple circuits.

property jaqal_program: str | None

Jaqal program(s) as a single string.

For multi-circuit compilation the string will contain subcircuits.

jaqal_programs = None
seq = None
class general_superstaq.compiler_output.CompilerOutput(circuits: str | list[str] | list[list[str]], initial_logical_to_physicals: dict[int, int] | list[dict[int, int]] | list[list[dict[int, int]]], final_logical_to_physicals: dict[int, int] | list[dict[int, int]] | list[list[dict[int, int]]], pulse_gate_circuits: Any | None = None, seq: Any | None = None, jaqal_programs: list[str] | None = None)

Bases: BaseCompilerOutput[str, int]

A class that arranges compiled circuit information.

general_superstaq.compiler_output.read_json_jaqal(json_dict: dict[str, Any], num_eca_circuits: int | None = None) CompilerOutput

Reads out the returned JSON from Superstaq API’s Jaqal compilation endpoint.

Parameters:
  • json_dict – A JSON dictionary matching the format returned by /compile endpoint.

  • num_eca_circuits – Number of logically equivalent random circuits to generate for each input circuit.

Returns:

A CompilerOutput object with the compiled Jaqal program(s).

general_superstaq.compiler_output.C
general_superstaq.compiler_output.Q