modules.applications.qml.qleet.analyzers.entanglement.EntanglementCapability

class EntanglementCapability(circuit: CircuitDescriptor, noise_model: NoiseModel | None = None, samples: int = 1000)

Bases: MetaExplorer

Calculates entangling capability of a parameterized quantum circuit

__init__(circuit: CircuitDescriptor, noise_model: NoiseModel | None = None, samples: int = 1000)

Constructor for entanglement capability plotter

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

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

  • samples -- number of samples for the experiment

:returns Entanglement object instance :raises ValueError: If circuit and noise model does not correspond to same framework

Methods

__init__(circuit[, noise_model, samples])

Constructor for entanglement capability plotter

entanglement_capability([measure, shots])

Returns entanglement measure for the given circuit

gen_params()

Generate parameters for the calculation of expressibility

meyer_wallach_measure(states, num_qubits)

Returns the meyer-wallach entanglement measure for the given circuit.

scott_helper(state, perms)

Helper function for entanglement measure.

scott_measure(states, num_qubits)

Returns the scott entanglement measure for the given circuit.

entanglement_capability(measure: str = 'meyer-wallach', shots: int = 1024) float

Returns entanglement measure for the given circuit

Parameters:
  • measure -- specification for the measure used in the entangling capability

  • shots -- number of shots for circuit execution

Returns pqc_entangling_capability (float):

entanglement measure value

Raises:

ValueError -- if invalid measure is specified

gen_params() Tuple[List, List]

Generate parameters for the calculation of expressibility

Return theta (np.array):

first list of parameters for the parameterized quantum circuit

Return phi (np.array):

second list of parameters for the parameterized quantum circuit

meyer_wallach_measure(states, num_qubits)

Returns the meyer-wallach entanglement measure for the given circuit.

Q = \frac{2}{|\vec{\theta}|}\sum_{\theta_{i}\in \vec{\theta}}
\Bigg(1-\frac{1}{n}\sum_{k=1}^{n}Tr(\rho_{k}^{2}(\theta_{i}))\Bigg)

static scott_helper(state, perms)

Helper function for entanglement measure. It gives trace of the output state

scott_measure(states, num_qubits)

Returns the scott entanglement measure for the given circuit.

Q_{m} = \frac{2^{m}}{(2^{m}-1) |\vec{\theta}|}\sum_{\theta_i \in \vec{\theta}}\
\bigg(1 - \frac{m! (n-m)!)}{n!}\sum_{|S|=m} \text{Tr} (\rho_{S}^2 (\theta_i)) \bigg)\
\quad m= 1, \ldots, \lfloor n/2 \rfloor