modules.applications.qml.qleet.analyzers.entanglement_spectrum.EntanglementSpectrum

class EntanglementSpectrum(circuit: CircuitDescriptor, noise_model: NoiseModel | None = None, samples: int = 1000, tapered_indices: tuple = (), cutoff: int = -30)

Bases: MetaExplorer

Calculates entanglement spectrum of a parameterized quantum circuit

__init__(circuit: CircuitDescriptor, noise_model: NoiseModel | None = None, samples: int = 1000, tapered_indices: tuple = (), cutoff: int = -30)

Constructor the the Expresssibility analyzer

Parameters:
  • circuit -- input circuit as a CircuitDescriptor object

  • noise_model -- (dict, NoiseModel) initialization noise-model dictionary

  • samples -- number of samples for the experiment

  • tapered_indices -- qubits to be tapered for bipartiting the system

  • cutoff -- minimum cutoff value for the eigenvalues

Raises:

ValueError -- If circuit and noise model does not correspond to same framework

Methods

__init__(circuit[, noise_model, samples, ...])

Constructor the the Expresssibility analyzer

entanglement_spectrum([measure, shots])

Returns entanglement spectrum divergence (ESD) for the circuit against Marchenko-Pastur distribution

gen_params()

Generate parameters for the calculation of expressibility

inverse_transform_sampling(data[, n_bins, ...])

Samples from a given distribution followed by a given set of data

kl_divergence(prob_a, prob_b)

Returns KL divergence between two probabilities

marchenko_pastur_pdf(x, gamma)

Computes the probability density function (PDF) for the Marchenko-Pastur distribution

plot(data[, figsize, dpi])

Returns plot for expressibility visualization

prob_pqc([shots])

Return probability density function of fidelities for PQC

entanglement_spectrum(measure: str = 'kld', shots: int = 1024) Tuple[float, ndarray]

Returns entanglement spectrum divergence (ESD) for the circuit against Marchenko-Pastur distribution

ESD = D_{KL}(\hat{P}_{PQC}(H_{\text{ent}}; \theta) | P_{Haar}(H_{\text{ent}}))\\
ESD = D_{\sqrt{JSD}}(\hat{P}_{PQC}(H_{\text{ent}}; \theta) | P_{Haar}(H_{\text{ent}}))

Parameters:
  • measure -- specifies measure used in the entanglement spectrum divergence calculation

  • shots -- number of shots for circuit execution

Returns pqc_esd:

float, entanglement spectrum divergence value

Raises:

ValueError -- if invalid measure is specified

gen_params() List[Dict[Any, Any]]

Generate parameters for the calculation of expressibility

Returns theta:

first list of parameters for the parameterized quantum circuit

static inverse_transform_sampling(data, n_bins=1000, n_samples=1000)

Samples from a given distribution followed by a given set of data

static kl_divergence(prob_a: ndarray, prob_b: ndarray) float

Returns KL divergence between two probabilities

static marchenko_pastur_pdf(x, gamma)

Computes the probability density function (PDF) for the Marchenko-Pastur distribution

plot(data, figsize=(6, 4), dpi=300, **kwargs)

Returns plot for expressibility visualization

prob_pqc(shots: int = 1024) Tuple[ndarray, ndarray]

Return probability density function of fidelities for PQC

Parameters:

shots -- number of shots for circuit execution

Returns eigvals (np.array):

np.array of all eigenvalues

Returns mean_eigvals (np.array):

np.array of sample-wise mean of all eigenvalues