qiskit_superstaq.superstaq_backend ================================== .. py:module:: qiskit_superstaq.superstaq_backend Classes ------- .. autoapisummary:: qiskit_superstaq.superstaq_backend.SuperstaqBackend Module Contents --------------- .. py:class:: SuperstaqBackend(provider: qiskit_superstaq.SuperstaqProvider, target: str) Bases: :py:obj:`qiskit.providers.BackendV2` This class represents a Superstaq backend. .. py:method:: aqt_compile(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], *, num_eca_circuits: int | None = None, random_seed: int | None = None, atol: float | None = None, gate_defs: collections.abc.Mapping[str, str | numpy.typing.NDArray[numpy.number[Any]] | None] | None = None, gateset: collections.abc.Mapping[str, collections.abc.Sequence[collections.abc.Sequence[int]]] | None = None, pulses: object = None, variables: object = None, **kwargs: Any) -> qiskit_superstaq.compiler_output.CompilerOutput Compiles and optimizes the given circuit(s) for the Advanced Quantum Testbed (AQT). AQT is a superconducting transmon quantum computing testbed at Lawrence Berkeley National Laboratory. More information can be found at https://aqt.lbl.gov. Specifying a nonzero value for `num_eca_circuits` enables compilation with Equivalent Circuit Averaging (ECA). See https://arxiv.org/abs/2111.04572 for a description of ECA. :param circuits: The circuit(s) to compile. :param num_eca_circuits: Optional number of logically equivalent random circuits to generate from each input circuit for Equivalent Circuit Averaging (ECA). :param random_seed: Optional seed used for approximate synthesis and ECA. :param atol: An optional tolerance to use for approximate gate synthesis. :param gate_defs: An optional dictionary mapping names in `qtrl` configs to operations, where each operation can be either a unitary matrix or None. More specific associations take precedence, for example `{"SWAP": , "SWAP/C5C4": }` implies `` for all "SWAP" calibrations except "SWAP/C5C4" (which will instead be mapped to `` applied to qubits 4 and 5). Setting any calibration to None will disable that calibration. :param gateset: Which gates to use for compilation. Should be a dictionary with entries in the for `gate_name: [[1, 2], [3, 4]`, where the keys refer to specific gates, and the values indicate which qubit(s) they act upon. :param pulses: Qtrl `PulseManager` or file path for pulse configuration. :param variables: Qtrl `VariableManager` or file path for variable configuration. :param kwargs: Other desired compile options. :returns: Object whose .circuit(s) attribute contains the optimized circuits(s). Alternatively for ECA, an Object whose .circuits attribute is a list (or list of lists) of logically equivalent circuits. If `qtrl` is installed, the object's .seq attribute is a qtrl Sequence object containing pulse sequences for each compiled circuit. :raises ValueError: If this is not an AQT backend. .. py:method:: compile(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], **kwargs: Any) -> qiskit_superstaq.compiler_output.CompilerOutput Compiles the given circuit(s) to the backend's native gateset. :param circuits: The qiskit.QuantumCircuit(s) to compile. :param kwargs: Other desired compile options. :returns: A `CompilerOutput` object whose .circuit(s) attribute contains optimized compiled circuit(s). :raises ValueError: If this backend does not support compilation. .. py:method:: configuration() -> qiskit.providers.models.BackendConfiguration Retrieves configuration information for this target. :returns: A backend configuration object containing various hardware parameters. .. py:method:: cq_compile(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], *, grid_shape: tuple[int, int] | None = None, control_radius: float = 1.0, stripped_cz_rads: float = 0.0, **kwargs: Any) -> qiskit_superstaq.compiler_output.CompilerOutput Compiles and optimizes the given circuit(s) for CQ devices. :param circuits: The qiskit.QuantumCircuit(s) to compile. :param grid_shape: Optional fixed dimensions for the rectangular qubit grid (by default the actual qubit layout will be pulled from the hardware provider). :param control_radius: The radius with which qubits remain connected (ie 1.0 indicates nearest neighbor connectivity). :param stripped_cz_rads: The angle in radians of the stripped cz gate. :param kwargs: Other desired compile options. :returns: A CQ `CompilerOutput` object. :raises ValueError: If this is not a CQ backend. .. py:method:: ibmq_compile(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], *, dynamical_decoupling: bool = True, dd_strategy: str = 'adaptive', **kwargs: Any) -> qiskit_superstaq.compiler_output.CompilerOutput Compiles and optimizes the given circuit(s) for IBMQ devices. Superstaq currently supports the following dynamical decoupling strategies: * "standard": Places a single DD sequence in each idle window. * "syncopated": Places DD pulses at fixed time intervals, alternating between pulses on neighboring qubits in order to mitigate parasitic ZZ coupling errors. * "adaptive" (default): Dynamically spaces DD pulses across idle windows with awareness of neighboring qubits to achieve the parasitic ZZ coupling mitigation of the "syncopated" strategy with fewer pulses and less discretization error. See https://superstaq.readthedocs.io/en/latest/optimizations/ibm/ibmq_dd_strategies_qiskit_superstaq.html for an example of each strategy. :param circuits: The qiskit.QuantumCircuit(s) to compile. :param dynamical_decoupling: Applies dynamical decoupling optimization to circuit(s). :param dd_strategy: Method to use for placing dynamical decoupling operations; should be either "standard", "syncopated", or "adaptive" (default). See above. :param kwargs: Other desired compile options. :returns: Object whose .circuit(s) attribute contains the compiled circuits(s), and whose .pulse_gate_circuit(s) attribute contains the corresponding pulse schedule(s) (when available). :raises ValueError: If this is not an IBMQ backend. .. py:method:: process_aces(job_id: str) -> list[float] Process a job submitted through `submit_aces`. :param job_id: The job id returned by `submit_aces`. :returns: The estimated eigenvalues. .. py:method:: qscout_compile(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], *, mirror_swaps: bool = False, base_entangling_gate: str = 'xx', num_qubits: int | None = None, error_rates: _typeshed.SupportsItems[tuple[int, Ellipsis], float] | None = None, **kwargs: Any) -> qiskit_superstaq.compiler_output.CompilerOutput Compiles and optimizes the given circuit(s) for the QSCOUT trapped-ion testbed at Sandia National Laboratories [1]. Compiled circuits are returned as both `qiskit.QuantumCircuit` objects and corresponding Jaqal [2] programs (strings). .. rubric:: References [1] S. M. Clark et al., Engineering the Quantum Scientific Computing Open User Testbed, IEEE Transactions on Quantum Engineering Vol. 2, 3102832 (2021). https://doi.org/10.1109/TQE.2021.3096480. [2] B. Morrison, et al., Just Another Quantum Assembly Language (Jaqal), 2020 IEEE International Conference on Quantum Computing and Engineering (QCE), 402-408 (2020). https://arxiv.org/abs/2008.08042. :param circuits: The circuit(s) to compile. :param mirror_swaps: Whether to use mirror swapping to reduce two-qubit gate overhead. :param base_entangling_gate: The base entangling gate to use ("xx", "zz", "sxx", or "szz"). Compilation with the "xx" and "zz" entangling bases will use arbitrary parameterized two-qubit interactions, while the "sxx" and "szz" bases will only use fixed maximally-entangling rotations. :param num_qubits: An optional number of qubits that should be present in the compiled circuit(s) and Jaqal program(s) (otherwise this will be determined from the input). :param error_rates: Optional dictionary assigning relative error rates to pairs of physical qubits, in the form `{: , ...}` where `` is a tuple physical qubit indices (ints) and `` is a relative error rate for gates acting on those qubits (for example `{(0, 1): 0.3, (1, 2): 0.2}`) . If provided, Superstaq will attempt to map the circuit to minimize the total error on each qubit. :param kwargs: Other desired qscout_compile options. :returns: Object whose .circuit(s) attribute contains optimized `qiskit.QuantumCircuit`(s), and `.jaqal_program(s)` attribute contains the corresponding Jaqal program(s). :raises ValueError: If this is not a QSCOUT backend. :raises ValueError: If `base_entangling_gate` is not a valid entangling basis. .. py:method:: resource_estimate(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit]) -> general_superstaq.ResourceEstimate | list[general_superstaq.ResourceEstimate] Generates resource estimates for qiskit circuit(s). :param circuits: The circuit(s) used during resource estimation. :returns: ResourceEstimate(s) containing resource costs (after compilation) for running circuit(s) on this backend. .. py:method:: retrieve_job(job_id: str) -> qiskit_superstaq.SuperstaqJob Gets a job that has been created on the Superstaq API. :param job_id: The UUID of the job. Jobs are assigned these numbers by the server during the :param creation of the job.: :returns: A `qiskit_superstaq.SuperstaqJob` which can be queried for status or results. :raises ~general_superstaq.SuperstaqServerException: If there was an error accessing the API. .. py:method:: run(circuits: qiskit.QuantumCircuit | collections.abc.Sequence[qiskit.QuantumCircuit], shots: int, method: str | None = None, **kwargs: Any) -> qiskit_superstaq.SuperstaqJob Runs circuits on the stored Superstaq backend. :param circuits: A list of circuits to run. :param shots: The number of execution shots (times to run the circuit). :param method: An optional string that describes the execution method (e.g. 'dry-run', 'statevector', etc.). :param kwargs: Other optimization and execution parameters. :returns: A Superstaq job storing ID and other related info. :raises ValueError: If `circuits` contains invalid circuits for submission. .. py:method:: submit_aces(qubits: collections.abc.Sequence[int], shots: int, num_circuits: int, mirror_depth: int, extra_depth: int, method: str | None = None, noise: str | None = None, error_prob: float | tuple[float, float, float] | None = None, tag: str | None = None, lifespan: int | None = None, weights: collections.abc.Iterable[int] | None = None) -> str Submits the jobs to characterize this target through the ACES protocol. The following gate eigenvalues are eestimated. For each qubit in the device, we consider six Clifford gates. These are given by the XZ maps: XZ, ZX, -YZ, -XY, ZY, YX. For each of these gates, three eigenvalues are returned (X, Y, Z, in that order). Then, the two-qubit gate considered here is the CZ in linear connectivity (each qubit n with n + 1). For this gate, 15 eigenvalues are considered: XX, XY, XZ, XI, YX, YY, YZ, YI, ZX, ZY, ZZ, ZI, IX, IY IZ, in that order. If n qubits are characterized, the first 18 * n entries of the list returned by `process_aces` will contain the single-qubit eigenvalues for each gate in the order above. After all the single-qubit eigenvalues, the next 15 * (n - 1) entries will contain for the CZ connections, in ascending order. The protocol in detail can be found in: https://arxiv.org/abs/2108.05803. :param qubits: A list with the qubit indices to characterize. :param shots: How many shots to use per circuit submitted. :param num_circuits: How many random circuits to use in the protocol. :param mirror_depth: The half-depth of the mirror portion of the random circuits. :param extra_depth: The depth of the fully random portion of the random circuits. :param method: Which type of method to execute the circuits with. :param noise: Noise model to simulate the protocol with. Valid strings are "symmetric_depolarize", "phase_flip", "bit_flip" and "asymmetric_depolarize". :param error_prob: The error probabilities if a string was passed to `noise`. * For "asymmetric_depolarize", `error_prob` will be a three-tuple with the error rates for the X, Y, Z gates in that order. So, a valid argument would be `error_prob = (0.1, 0.1, 0.1)`. Notice that these values must add up to less than or equal to 1. * For the other channels, `error_prob` is one number less than or equal to 1, e.g., `error_prob = 0.1`. :param tag: Tag for all jobs submitted for this protocol. :param lifespan: How long to store the jobs submitted for in days (only works with right permissions). :param weights: Valid Pauli string weights for probes. :returns: A string with the job id for the ACES job created. :raises AssertionError: If the weights are not an Iterable type. :raises ValueError: If the target or noise model is not valid. :raises ~general_superstaq.SuperstaqServerException: If the request fails. .. py:method:: target_info() -> dict[str, Any] Retrieves configuration information for this target. :returns: A dictionary containing various hardware parameters. .. py:property:: coupling_map :type: qiskit.transpiler.CouplingMap | None A coupling map generated from the two-qubit gates supported by this backend. .. py:property:: max_circuits :type: int | None The maximum number of circuits that can be submitted to this backend. .. py:property:: target :type: qiskit.transpiler.Target A `qiskit.transpiler.Target` object for this backend.