unitaria.BackendEstimator

class unitaria.BackendEstimator(default_precision: float, default_failure_probability: float = 0.01, qubits: int = 0, **backend_kwargs)[source]

Bases: Estimator

Estimator based on a simulated or hardware backend.

Parameters:
  • default_precision – Default for the precision parameter in estimate_norm.

  • default_failure_probability – Default for the failure_probability parameter in estimate_norm.

  • qubits – Determines how many ancillae are passed to Node.circuit. Specifically, the total qubits passed to that function will be the maximum of qubits or the qubits required to encode the node. If you want to run circuits for a specific device, set qubits to the number of qubits in that device.

  • backend_kwargs – Parameters of the backend. See simulate().

estimate_norm(node: Node, precision: float | None = None, failure_probability: float | None = None) → float[source]
Raises:

ValueError – If the node does not represent a vector.