qward.metrics.quantum_specific_metrics.QuantumSpecificMetrics

class QuantumSpecificMetrics(circuit)[source]

Extract intrinsically quantum metrics from QuantumCircuit objects.

Quantum-specific metrics provide insight into the true quantum behavior of a circuit, its resource requirements, and its expected difficulty for classical simulation. They complement structural and element-level metrics by focusing exclusively on quantum effects arising from the circuit’s transformations and state evolution.

circuit

The quantum circuit to analyze (inherited from MetricCalculator).

Type:

QuantumCircuit

_circuit_dag

DAG representation of the circuit, used for structural traversal when computing quantum-specific metrics.

Type:

DAGCircuit | None

_torch_available

Indicates whether PyTorch is available for metrics that rely on differentiable simulation or gradient-based optimization.

Type:

bool

_max_steps

Maximum number of optimization steps used in iterative or differentiable metrics (e.g., magic or sensitivity estimation).

Type:

int

_lr

Learning rate used for gradient-based optimization of certain metrics.

Type:

float

_device

Device specification (“cpu” or “cuda”) for metrics that may leverage PyTorch computation.

Type:

str

_use_trace_norm

Whether to use the trace norm when computing specific quantum sensitivity or distance-based metrics.

Type:

bool

Inicializa el calculador de métricas cuánticas específicas.

__init__(circuit)[source]

Inicializa el calculador de métricas cuánticas específicas.

Methods

__init__(circuit)

Inicializa el calculador de métricas cuánticas específicas.

get_metrics()

Calculate and return quantum specific metrics.

is_ready()

Check if the metric is ready to be calculated.

Attributes

circuit

Get the quantum circuit.

id

Get the ID of the metric.

metric_type

Get the type of this metric.

name

Get the name of the metric.