randomized_measure

EntropyMeasureRandomized - The Second Order Renyi Entropy by Randomized Measurement (qurry.qurrent.randomized_measure)

arguments

EntropyMeasureRandomized - Arguments (qurry.qurrent.randomized_measure.arguments)

class qurry.qurrent.randomized_measure.arguments.EntropyMeasureRandomizedAnalyzeArgs[source]

The input of the analyze method.

backend: Literal['Cython', 'Rust', 'Python'] | str

The backend for the process.

counts_used: Iterable[int] | None

The index of the counts used.

independent_all_system: bool

If True, then calculate the all system independently.

selected_qubits: list[int] | None

The selected qubits.

class qurry.qurrent.randomized_measure.arguments.EntropyMeasureRandomizedArguments(exp_name: str = 'exps', times: int = 100, qubits_measured: list[int] | None = None, registers_mapping: dict[int, int] | None = None, actual_num_qubits: int = 0, unitary_located: list[int] | None = None, random_unitary_seeds: dict[int, dict[int, int]] | None = None)[source]

Arguments for the experiment.

actual_num_qubits: int = 0

The actual number of qubits.

exp_name: str = 'exps'

The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘experiment’.

qubits_measured: list[int] | None = None

The measure range.

random_unitary_seeds: dict[int, dict[int, int]] | None = None

The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds() in qurry.qurrium.utils.random_unitary.

registers_mapping: dict[int, int] | None = None

The mapping of the classical registers of measurement with quantum registers.

The key is the index of the quantum register with the numerical order. The value is the index of the classical register with the numerical order.

times: int = 100

The number of random unitary operator. It will denote as N_U in the experiment name.

unitary_located: list[int] | None = None

The range of the unitary operator.

class qurry.qurrent.randomized_measure.arguments.EntropyMeasureRandomizedMeasureArgs[source]

Output arguments for output().

measure: tuple[int, int] | int | list[int] | None

The measure range.

random_unitary_seeds: dict[int, dict[int, int]] | None

The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds() in qurry.qurrium.utils.random_unitary.

times: int

The number of random unitary operator. It will denote as N_U in the experiment name.

unitary_loc: tuple[int, int] | int | list[int] | None

The range of the unitary operator.

unitary_loc_not_cover_measure: bool

Whether the range of the unitary operator is not cover the measure range.

wave: QuantumCircuit | Hashable | None

The key or the circuit to execute.

class qurry.qurrent.randomized_measure.arguments.EntropyMeasureRandomizedOutputArgs[source]

Output arguments for output().

measure: tuple[int, int] | int | list[int] | None

The measure range.

random_unitary_seeds: dict[int, dict[int, int]] | None

The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds() in qurry.qurrium.utils.random_unitary.

times: int

The number of random unitary operator. It will denote as N_U in the experiment name.

unitary_loc: tuple[int, int] | int | list[int] | None

The range of the unitary operator.

unitary_loc_not_cover_measure: bool

Whether the range of the unitary operator is not cover the measure range.

analysis

EntropyMeasureRandomized - Analysis (qurry.qurrent.randomized_measure.analysis)

class qurry.qurrent.randomized_measure.analysis.EMRAnalysisContent(purity: float | None = None, entropy: float | None = None, puritySD: float | None = None, entropySD: float | None = None, purityCells: dict[int, float] | None = None, num_classical_registers: int | None = None, classical_registers: list[int] | None = None, classical_registers_actually: list[int] | None = None, all_system_source: str | Literal['independent', 'null_counts'] | None = None, purityAllSys: float | None = None, entropyAllSys: float | None = None, puritySDAllSys: float | None = None, entropySDAllSys: float | None = None, purityCellsAllSys: dict[int, float] | None = None, num_classical_registers_all_sys: int | None = None, classical_registers_all_sys: list[int] | None = None, classical_registers_actually_all_sys: list[int] | None = None, errorRate: float | None = None, mitigatedPurity: float | None = None, mitigatedEntropy: float | None = None, counts_num: int | None = None, taking_time: float | None = None, taking_time_all_sys: float | None = None, counts_used: Iterable[int] | None = None)[source]

The content of the analysis.

all_system_source: str | Literal['independent', 'null_counts'] | None

The name of source of all system.

  • independent: The all system is calculated independently.

  • null_counts: No counts exist.

classical_registers: list[int] | None

The list of the index of the selected classical registers.

classical_registers_actually: list[int] | None

The list of the index of the selected classical registers which is actually used.

classical_registers_actually_all_sys: list[int] | None

The list of the index of the selected classical registers which is actually used.

classical_registers_all_sys: list[int] | None

The list of the index of the selected classical registers.

counts_num: int | None

The number of counts.

counts_used: Iterable[int] | None

The index of the counts used. If not specified, then use all counts.

entropy: float | None

The entanglement entropy of the subsystem.

entropyAllSys: float | None

The entanglement entropy of the system.

entropySD: float | None

The standard deviation of the entanglement entropy of the subsystem.

entropySDAllSys: float | None

The standard deviation of the entanglement entropy of the system.

errorRate: float | None

The error rate of the measurement from depolarizing error migigation calculated.

mitigatedEntropy: float | None

The mitigated entanglement entropy of the subsystem.

mitigatedPurity: float | None

The mitigated purity of the subsystem.

num_classical_registers: int | None

The number of classical registers.

num_classical_registers_all_sys: int | None

The number of classical registers of all system.

purity: float | None

The purity of the subsystem.

purityAllSys: float | None

The purity of the system.

purityCells: dict[int, float] | None

The purity of each cell of the subsystem.

purityCellsAllSys: dict[int, float] | None

The purity of each cell of the system.

puritySD: float | None

The standard deviation of the purity of the subsystem.

puritySDAllSys: float | None

The standard deviation of the purity of the system.

taking_time: float | None

The calculation time.

taking_time_all_sys: float | None

The calculation time of the all system.

class qurry.qurrent.randomized_measure.analysis.EMRAnalysisInput(num_qubits: int, selected_qubits: list[int], registers_mapping: dict[int, int], bitstring_mapping: dict[int, int] | None, shots: int, unitary_located: list[int] | None = None)[source]

To set the analysis.

bitstring_mapping: dict[int, int] | None

The mapping of the bitstring with the classical registers. When there are mulitple classical registers, the bitstring is the concatenation of the classical registers with space on bitstring. For example, there are three registers with the size of 4, 4, and 6, which the first six bits are for the randomized measurement.

So, the mapping will be like this.

{
    0: 10, # The classical register 0 is mapped to the bitstring on the index 0.
    1: 11, # The classical register 0 is mapped to the bitstring on the index 1.
    2: 12, # The classical register 0 is mapped to the bitstring on the index 2.
    3: 13, # The classical register 0 is mapped to the bitstring on the index 3.
    4: 14, # The classical register 0 is mapped to the bitstring on the index 4.
    5: 15, # The classical register 0 is mapped to the bitstring on the index 5.
}

But, if there is only one classical register, the bitstring will map to the classical register directly.

Will be like this.

num_qubits: int

The number of qubits.

registers_mapping: dict[int, int]

The mapping of the classical registers with quantum registers.

The key is the index of the quantum register with the numerical order. The value is the index of the classical register with the numerical order.

selected_qubits: list[int]

The selected qubits.

shots: int

The number of shots.

unitary_located: list[int] | None

The range of the unitary operator.

class qurry.qurrent.randomized_measure.analysis.EntropyMeasureRandomizedAnalysis(*, serial: int, log: dict[str, Any] | None = None, datatime: str | None = None, **other_kwargs)[source]

The container for the analysis of :cls:`EntropyRandomizedExperiment`.

classmethod content_type() Type[EMRAnalysisContent][source]

The content instance type.

classmethod input_type() Type[EMRAnalysisInput][source]

The input instance type.

property side_product_fields: Iterable[str]

The fields that will be stored as side product.

utils

EntropyMeasureRandomized - Utility (qurry.qurrent.randomized_measure.utils)

qurry.qurrent.randomized_measure.utils.bitstring_mapping_getter(counts: list[dict[str, int]], registers_mapping: dict[int, int]) tuple[dict[int, int], dict[int, int]][source]

Get the bitstring mapping and the final mapping.

Parameters:
  • counts (list[dict[str, int]]) – The counts of the experiment.

  • registers_mapping (dict[int, int]) – The mapping of the index of selected qubits to the index of the classical register.

Returns:

The bitstring mapping and the final mapping.

Return type:

tuple[dict[int, int], dict[int, int]]

qurry.qurrent.randomized_measure.utils.circuit_method_compose(idx: int, target_circuit: QuantumCircuit, target_key: Hashable, exp_name: str, registers_mapping: dict[int, int], single_unitary_dict: dict[int, Operator]) QuantumCircuit[source]

Build the circuit for the experiment.

Parameters:
  • idx (int) – Index of the quantum circuit.

  • target_circuit (QuantumCircuit) – Target circuit.

  • target_key (Hashable) – Target key.

  • exp_name (str) – Experiment name.

  • registers_mapping (dict[int, int]) – The mapping of the index of selected qubits to the index of the classical register.

  • single_unitary_dict (dict[int, Operator]) – The dictionary of the unitary operator.

Returns:

The circuit for the experiment.

Return type:

QuantumCircuit

qurry.qurrent.randomized_measure.utils.randomized_circuit_method(idx: int, target_circuit: QuantumCircuit, target_key: Hashable, exp_name: str, registers_mapping: dict[int, int], single_unitary_dict: dict[int, Operator]) QuantumCircuit[source]

Build the circuit for the experiment.

Parameters:
  • idx (int) – Index of the quantum circuit.

  • target_circuit (QuantumCircuit) – Target circuit.

  • target_key (Hashable) – Target key.

  • exp_name (str) – Experiment name.

  • registers_mapping (dict[int, int]) – The mapping of the index of selected qubits to the index of the classical register.

  • single_unitary_dict (dict[int, Operator]) – The dictionary of the unitary operator.

Returns:

The circuit for the experiment.

Return type:

QuantumCircuit

qurry.qurrent.randomized_measure.utils.randomized_entangled_entropy_complex(shots: int, counts: list[dict[str, int]], selected_classical_registers: Iterable[int] | None = None, all_system_source: EntropyMeasureRandomizedAnalysis | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) EntangledEntropyResultMitigated[source]

Randomized entangled entropy with complex.

Parameters:
  • shots (int) – The number of shots.

  • counts (list[dict[str, int]]) – The counts of the experiment.

  • selected_classical_registers (Optional[Iterable[int]], optional) – The selected classical registers. Defaults to None.

  • all_system_source (Optional[EntropyRandomizedAnalysis], optional) – The source of all system. Defaults to None.

  • backend (PostProcessingBackendLabel, optional) – The backend label. Defaults to DEFAULT_PROCESS_BACKEND.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar. Defaults to None.

Returns:

The result of the entangled entropy.

Return type:

EntangledEntropyResultMitigated

experiment

EntropyMeasureRandomized - Experiment (qurry.qurrent.randomized_measure.experiment)

class qurry.qurrent.randomized_measure.experiment.EntropyMeasureRandomizedExperiment(arguments: _A | dict[str, Any], commonparams: Commonparams | dict[str, Any], outfields: dict[str, Any], beforewards: Before | None = None, afterwards: After | None = None, reports: AnalysesContainer | None = None)[source]

The instance of experiment.

property analysis_instance: Type[EntropyMeasureRandomizedAnalysis]

The analysis instance for this experiment.

analyze(selected_qubits: Iterable[int] | None = None, independent_all_system: bool = False, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', counts_used: Iterable[int] | None = None, pbar: tqdm | None = None) EntropyMeasureRandomizedAnalysis[source]

Calculate entangled entropy with more information combined.

Parameters:
  • selected_qubits (Optional[Iterable[int]], optional) – The selected qubits. Defaults to None.

  • independent_all_system (bool, optional) – If True, then calculate the all system independently. Defaults to False.

  • backend (PostProcessingBackendLabel, optional) – The backend for the process. Defaults to DEFAULT_PROCESS_BACKEND.

  • counts_used (Optional[Iterable[int]], optional) – The index of the counts used. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar. Defaults to None.

Returns:

The result of the analysis.

Return type:

EntropyMeasureRandomizedAnalysis

property arguments_instance: Type[EntropyMeasureRandomizedArguments]

The arguments instance for this experiment.

classmethod method(targets: list[tuple[Hashable, QuantumCircuit]], arguments: EntropyMeasureRandomizedArguments, pbar: tqdm | None = None, multiprocess: bool = True) tuple[list[QuantumCircuit], dict[str, Any]][source]

The method to construct circuit.

Parameters:
  • targets (list[tuple[Hashable, QuantumCircuit]]) – The circuits of the experiment.

  • arguments (EntropyMeasureRandomizedArguments) – The arguments of the experiment.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

  • multiprocess (bool, optional) – Whether to use multiprocessing. Defaults to True.

Returns:

The circuits of the experiment and the side products.

Return type:

tuple[list[QuantumCircuit], dict[str, Any]]

classmethod params_control(targets: list[tuple[Hashable, QuantumCircuit]], exp_name: str = 'exps', times: int = 100, measure: tuple[int, int] | int | list[int] | None = None, unitary_loc: tuple[int, int] | int | list[int] | None = None, unitary_loc_not_cover_measure: bool = False, random_unitary_seeds: dict[int, dict[int, int]] | None = None, **custom_kwargs: Any) tuple[EntropyMeasureRandomizedArguments, Commonparams, dict[str, Any]][source]

Handling all arguments and initializing a single experiment.

Parameters:
  • targets (list[tuple[Hashable, QuantumCircuit]]) – The circuits of the experiment.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘exps’.

  • times (int, optional) – The number of random unitary operator. Defaults to 100. It will denote as N_U in the experiment name.

  • measure (Optional[Union[list[int], tuple[int, int], int]], optional) – The selected qubits for the measurement. If it is None, then it will return the mapping of all qubits. If it is int, then it will return the mapping of the last n qubits. If it is tuple, then it will return the mapping of the qubits in the range. If it is list, then it will return the mapping of the selected qubits. Defaults to None.

  • unitary_loc (Optional[Union[list[int], tuple[int, int], int]], optional) – The range of the unitary operator. Defaults to None.

  • unitary_loc_not_cover_measure (bool, optional) – Confirm that not all unitary operator are covered by the measure. If True, then close the warning. Defaults to False.

  • random_unitary_seeds (Optional[dict[int, dict[int, int]]], optional) –

    The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

    If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds() in qurry.qurrium.utils.random_unitary.

  • custom_kwargs (Any) – The custom parameters.

Raises:
  • ValueError – If the number of targets is not one.

  • TypeError – If times is not an integer.

  • ValueError – If the range of measure is not in the range of unitary_loc.

Returns:

The arguments of the experiment, the common parameters, and the custom parameters.

Return type:

tuple[EntropyMeasureRandomizedArguments, Commonparams, dict[str, Any]]

classmethod quantities(shots: int | None = None, counts: list[dict[str, int]] | None = None, selected_classical_registers: Iterable[int] | None = None, all_system_source: EntropyMeasureRandomizedAnalysis | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) EntangledEntropyResultMitigated[source]

Randomized entangled entropy with complex.

Parameters:
  • shots (int) – The number of shots.

  • counts (list[dict[str, int]]) – The counts of the experiment.

  • selected_classical_registers (Optional[Iterable[int]], optional) – The selected classical registers. Defaults to None.

  • all_system_source (Optional[EntropyRandomizedAnalysis], optional) – The source of all system. Defaults to None.

  • backend (PostProcessingBackendLabel, optional) – The backend label. Defaults to DEFAULT_PROCESS_BACKEND.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar. Defaults to None.

Returns:

The result of the entangled entropy.

Return type:

EntangledEntropyResultMitigated

qurry

EntropyMeasureRandomized - Qurrium (qurry.qurrent.randomized_measure.qurry)

class qurry.qurrent.randomized_measure.qurry.EntropyMeasureRandomized[source]

Randomized Measure for entangled entropy. The entropy we compute is the Second Order Rényi Entropy.

Note

  • Probing Rényi entanglement entropy via randomized measurements -

Tiff Brydges, Andreas Elben, Petar Jurcevic, Benoît Vermersch, Christine Maier, Ben P. Lanyon, Peter Zoller, Rainer Blatt ,and Christian F. Roos , [doi:10.1126/science.aau4963](

  • Simple mitigation of global depolarizing errors in quantum simulations -

Vovrosh, Joseph and Khosla, Kiran E. and Greenaway, Sean and Self, Christopher and Kim, M. S. and Knolle, Johannes, [PhysRevE.104.035309](

@article{doi:10.1126/science.aau4963,
    author = {Tiff Brydges  and Andreas Elben  and Petar Jurcevic
        and Benoît Vermersch  and Christine Maier  and Ben P. Lanyon
        and Peter Zoller  and Rainer Blatt  and Christian F. Roos },
    title = {Probing Rényi entanglement entropy via randomized measurements},
    journal = {Science},
    volume = {364},
    number = {6437},
    pages = {260-263},
    year = {2019},
    doi = {10.1126/science.aau4963},
    URL = {https://www.science.org/doi/abs/10.1126/science.aau4963},
    eprint = {https://www.science.org/doi/pdf/10.1126/science.aau4963},
    abstract = {Quantum systems are predicted to be better at information
    processing than their classical counterparts, and quantum entanglement
    is key to this superior performance. But how does one gauge the degree
    of entanglement in a system? Brydges et al. monitored the build-up of
    the so-called Rényi entropy in a chain of up to 10 trapped calcium ions,
    each of which encoded a qubit. As the system evolved,
    interactions caused entanglement between the chain and the rest of
    the system to grow, which was reflected in the growth of
    the Rényi entropy. Science, this issue p. 260 The buildup of entropy
    in an ion chain reflects a growing entanglement between the chain
    and its complement. Entanglement is a key feature of many-body quantum systems.
    Measuring the entropy of different partitions of a quantum system
    provides a way to probe its entanglement structure.
    Here, we present and experimentally demonstrate a protocol
    for measuring the second-order Rényi entropy based on statistical correlations
    between randomized measurements. Our experiments, carried out with a trapped-ion
    quantum simulator with partition sizes of up to 10 qubits,
    prove the overall coherent character of the system dynamics and
    reveal the growth of entanglement between its parts,
    in both the absence and presence of disorder.
    Our protocol represents a universal tool for probing and
    characterizing engineered quantum systems in the laboratory,
    which is applicable to arbitrary quantum states of up to
    several tens of qubits.}}

@article{PhysRevE.104.035309,
    title = {Simple mitigation of global depolarizing errors in quantum simulations},
    author = {Vovrosh, Joseph and Khosla, Kiran E. and Greenaway, Sean and Self,
    Christopher and Kim, M. S. and Knolle, Johannes},
    journal = {Phys. Rev. E},
    volume = {104},
    issue = {3},
    pages = {035309},
    numpages = {8},
    year = {2021},
    month = {Sep},
    publisher = {American Physical Society},
    doi = {10.1103/PhysRevE.104.035309},
    url = {https://link.aps.org/doi/10.1103/PhysRevE.104.035309}
}
property experiment_instance: Type[EntropyMeasureRandomizedExperiment]

The container class responding to this QurryV5 class.

measure(wave: QuantumCircuit | Hashable | None = None, times: int = 100, measure: tuple[int, int] | int | list[int] | None = None, unitary_loc: tuple[int, int] | int | list[int] | None = None, unitary_loc_not_cover_measure: bool = False, random_unitary_seeds: dict[int, dict[int, int]] | None = None, shots: int = 1024, backend: Backend | None = None, exp_name: str = 'experiment', run_args: BaseRunArgs | dict[str, Any] | None = None, transpile_args: TranspileArgs | None = None, passmanager: str | PassManager | tuple[str, PassManager] | None = None, tags: tuple[str, ...] | None = None, qasm_version: Literal['qasm2', 'qasm3'] = 'qasm3', export: bool = False, save_location: Path | str | None = None, pbar: tqdm | None = None) str[source]

Execute the experiment.

Parameters:
  • wave (Union[QuantumCircuit, Hashable]) – The key or the circuit to execute.

  • times (int, optional) – The number of random unitary operator. It will denote as N_U in the experiment name. Defaults to 100.

  • measure (Optional[Union[list[int], tuple[int, int], int]], optional) – The selected qubits for the measurement. If it is None, then it will return the mapping of all qubits. If it is int, then it will return the mapping of the last n qubits. If it is tuple, then it will return the mapping of the qubits in the range. If it is list, then it will return the mapping of the selected qubits. Defaults to None.

  • unitary_loc (Optional[Union[list[int], tuple[int, int], int]], optional) – The range of the unitary operator. Defaults to None.

  • unitary_loc_not_cover_measure (bool, optional) – Whether the range of the unitary operator is not cover the measure range. Defaults to False.

  • random_unitary_seeds (Optional[dict[int, dict[int, int]]], optional) –

    The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

    If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds in qurry.qurrium.utils.random_unitary.

  • shots (int, optional) – Shots of the job. Defaults to 1024.

  • backend (Optional[Backend], optional) – The quantum backend. Defaults to None.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘exps’.

  • run_args (RunArgsType, optional) – Arguments for Backend.run(). Defaults to None.

  • transpile_args (Optional[TranspileArgs], optional) – Arguments of transpile() from qiskit.compiler.transpiler. Defaults to None.

  • passmanager (Optional[Union[str, PassManager, tuple[str, PassManager]], optional) – The passmanager. Defaults to None.

  • tags (Optional[tuple[str, ...]], optional) – The tags of the experiment. Defaults to None.

  • qasm_version (Literal["qasm2", "qasm3"], optional) – The version of OpenQASM. Defaults to “qasm3”.

  • export (bool, optional) – Whether to export the experiment. Defaults to False.

  • save_location (Optional[Union[Path, str]], optional) – The location to save the experiment. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

Returns:

The experiment ID.

Return type:

str

measure_to_output(wave: QuantumCircuit | Hashable | None = None, times: int = 100, measure: tuple[int, int] | int | list[int] | None = None, unitary_loc: tuple[int, int] | int | list[int] | None = None, unitary_loc_not_cover_measure: bool = False, random_unitary_seeds: dict[int, dict[int, int]] | None = None, shots: int = 1024, backend: Backend | None = None, exp_name: str = 'experiment', run_args: BaseRunArgs | dict[str, Any] | None = None, transpile_args: TranspileArgs | None = None, passmanager: str | PassManager | tuple[str, PassManager] | None = None, tags: tuple[str, ...] | None = None, qasm_version: Literal['qasm2', 'qasm3'] = 'qasm3', export: bool = False, save_location: Path | str | None = None, pbar: tqdm | None = None) EntropyMeasureRandomizedOutputArgs[source]

Trasnform measure() arguments form into output() form.

Parameters:
  • wave (Union[QuantumCircuit, Hashable]) – The key or the circuit to execute.

  • times (int, optional) – The number of random unitary operator. It will denote as N_U in the experiment name. Defaults to 100.

  • measure (Optional[Union[list[int], tuple[int, int], int]], optional) – The selected qubits for the measurement. If it is None, then it will return the mapping of all qubits. If it is int, then it will return the mapping of the last n qubits. If it is tuple, then it will return the mapping of the qubits in the range. If it is list, then it will return the mapping of the selected qubits. Defaults to None.

  • unitary_loc (Optional[Union[list[int], tuple[int, int], int]], optional) – The range of the unitary operator. Defaults to None.

  • unitary_loc_not_cover_measure (bool, optional) – Whether the range of the unitary operator is not cover the measure range. Defaults to False.

  • random_unitary_seeds (Optional[dict[int, dict[int, int]]], optional) –

    The seeds for all random unitary operator. This argument only takes input as type of dict[int, dict[int, int]]. The first key is the index for the random unitary operator. The second key is the index for the qubit.

    If you want to generate the seeds for all random unitary operator, you can use the function generate_random_unitary_seeds in qurry.qurrium.utils.random_unitary.

  • shots (int, optional) – Shots of the job. Defaults to 1024.

  • backend (Optional[Backend], optional) – The quantum backend. Defaults to None.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘exps’.

  • run_args (RunArgsType, optional) – Arguments for Backend.run(). Defaults to None.

  • transpile_args (Optional[TranspileArgs], optional) – Arguments of transpile() from qiskit.compiler.transpiler. Defaults to None.

  • passmanager (Optional[Union[str, PassManager, tuple[str, PassManager]], optional) – The passmanager. Defaults to None.

  • tags (Optional[tuple[str, ...]], optional) – The tags of the experiment. Defaults to None.

  • qasm_version (Literal["qasm2", "qasm3"], optional) – The version of OpenQASM. Defaults to “qasm3”.

  • export (bool, optional) – Whether to export the experiment. Defaults to False.

  • save_location (Optional[Union[Path, str]], optional) – The location to save the experiment. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

Returns:

The output arguments.

Return type:

EntropyMeasureRandomizedOutputArgs

multiAnalysis(summoner_id: str, *, analysis_name: str = 'report', no_serialize: bool = False, specific_analysis_args: dict[Hashable, EntropyMeasureRandomizedAnalyzeArgs | dict[str, Any] | bool] | None = None, skip_write: bool = False, multiprocess_write: bool = False, selected_qubits: list[int] | None = None, independent_all_system: bool = False, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', counts_used: Iterable[int] | None = None, **analysis_args) str[source]

Run the analysis for multiple experiments.

Parameters:
  • summoner_id (str) – The summoner_id of multimanager.

  • analysis_name (str, optional) – The name of analysis. Defaults to ‘report’.

  • no_serialize (bool, optional) – Whether to serialize the analysis. Defaults to False.

  • ( (specific_analysis_args) – SpecificAnalsisArgs[EntropyMeasureRandomizedAnalyzeArgs], optional

  • ) – The specific arguments for analysis. Defaults to None.

  • skip_write (bool, optional) – Whether to skip the file writing during the analysis. Defaults to False.

  • multiprocess_write (bool, optional) – Whether use multiprocess for writing. Defaults to False.

  • selected_qubits (Optional[list[int]], optional) – The selected qubits. Defaults to None.

  • independent_all_system (bool, optional) – Whether to treat all system as independent. Defaults to False.

  • backend (PostProcessingBackendLabel, optional) – The backend for the postprocessing. Defaults to DEFAULT_PROCESS_BACKEND.

  • counts_used (Optional[Iterable[int]], optional) – The counts used for the analysis. Defaults to None.

Returns:

The summoner_id of multimanager.

Return type:

str

short_name = 'qurrent_randomized'

The short name of Qurrium.