entangled_entropy_v1
¶
Post Processing - Randomized Measure - Entangled Entropy V1
(qurry.process.randomized_measure.entangled_entropy_v1
)
This is a deprecated version of entangled entropy calculation.
- Reference:
Randomized Measure - Entangled 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](
Statistical correlations between locally randomized measurements:
A toolbox for probing entanglement in many-body quantum states - A. Elben, B. Vermersch, C. F. Roos, and P. Zoller, [PhysRevA.99.052323](
)
Error Mitigation
Note
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](
entangled_entropy
¶
Post Processing - Randomized Measure - Entangled Entropy V1 - Entangled Entropy Deprecated
(qurry.process.randomized_measure.entangled_entropy_v1.entangled_entropy
)
- qurry.process.randomized_measure.entangled_entropy_v1.entangled_entropy.preparing_all_system(shots: int, counts: list[dict[str, int]], measure: tuple[int, int] | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', workers_num: int | None = None, existed_all_system: ExistingAllSystemSource | None = None) tuple[dict[int, float] | dict[int, float64], tuple[int, int] | list[int], tuple[int, int] | list[int], float, str] [source]¶
Prepare the all system source for entangled entropy calculation.
- Parameters:
shots (int) – Shots of the counts.
counts (list[dict[str, int]]) – Counts from randomized measurement results.
measure (Optional[tuple[int, int]], optional) – The range that implemented the measuring gate. If not specified, then use all qubits. This will affect the range of partition when you not implement the measuring gate on all qubit. Defaults to None.
backend (PostProcessingBackendLabel, optional) – Backend for the post-processing. Defaults to DEFAULT_PROCESS_BACKEND.
workers_num (Optional[int], optional) – Number of multi-processing workers, it will be ignored if backend is Rust. if sets to 1, then disable to using multi-processing; if not specified, then use the number of all cpu counts by os.cpu_count(). This only works for Python and Cython backend. Defaults to None.
existed_all_system (Optional[ExistingAllSystemSource], optional) – Existing all system source. If there is known all system result, then you can put it here to save a lot of time on calculating all system for not matter what partition you are using, their all system result is the same. All system source should contain purityCellsAllSys, bitStringRange, measureActually, source for its name. This can save a lot of time Defaults to None.
- Returns:
purity_cell_list_allsys: list of purity of all system.
bitstring_range_allsys: The range of partition on the bitstring of all system.
measure_range_allsys: The range of partition refer to all qubits of all system.
taken_allsys: The time taken to calculate all system.
- source: The source of all system,
it can be “independent” or the source of existed_all_system.
- Return type:
A tuple contains
- qurry.process.randomized_measure.entangled_entropy_v1.entangled_entropy.randomized_entangled_entropy_mitigated_v1(shots: int, counts: list[dict[str, int]], degree: int | tuple[int, int] | None, measure: tuple[int, int] | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', workers_num: int | None = None, existed_all_system: ExistingAllSystemSource | None = None, pbar: tqdm | None = None) RandomizedEntangledEntropyMitigatedComplex [source]¶
Calculate entangled entropy with depolarizing error mitigation. The entropy we compute is the Second Order Rényi Entropy.
- Reference:
Randomized Measure - Entangled 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](
Statistical correlations between locally randomized measurements:
A toolbox for probing entanglement in many-body quantum states - A. Elben, B. Vermersch, C. F. Roos, and P. Zoller, [PhysRevA.99.052323](
)
Error Mitigation
Note
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](
- Parameters:
shots (int) – Shots of the counts.
counts (list[dict[str, int]]) – Counts from randomized measurement results.
degree (Optional[Union[tuple[int, int], int]]) – The range of partition.
measure (Optional[tuple[int, int]], optional) – The range that implemented the measuring gate. If not specified, then use all qubits. This will affect the range of partition when you not implement the measuring gate on all qubit. Defaults to None.
backend (PostProcessingBackendLabel, optional) – Backend for the post-processing. Defaults to DEFAULT_PROCESS_BACKEND.
workers_num (Optional[int], optional) – Number of multi-processing workers, it will be ignored if backend is Rust. if sets to 1, then disable to using multi-processing; if not specified, then use the number of all cpu counts by os.cpu_count(). This only works for Python and Cython backend. Defaults to None.
existed_all_system (Optional[ExistingAllSystemSource], optional) – Existing all system source. If there is known all system result, then you can put it here to save a lot of time on calculating all system for not matter what partition you are using, their all system result is the same. All system source should contain purityCellsAllSys, bitStringRange, measureActually, source for its name. This can save a lot of time Defaults to None.
pbar (Optional[tqdm.tqdm], optional) – The progress bar API, you can use put a :cls:`tqdm` object here. This function will update the progress bar description. Defaults to None.
- Returns:
- A dictionary contains
purity, entropy, a list of each overlap, puritySD, purity of all system, entropy of all system, a list of each overlap in all system, puritySD of all system, degree, actual measure range, actual measure range in all system, bitstring range.
- Return type:
- qurry.process.randomized_measure.entangled_entropy_v1.entangled_entropy.randomized_entangled_entropy_v1(shots: int, counts: list[dict[str, int]], degree: int | tuple[int, int] | None, measure: tuple[int, int] | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', workers_num: int | None = None, pbar: tqdm | None = None) RandomizedEntangledEntropyComplex [source]¶
Calculate entangled entropy. The entropy we compute is the Second Order Rényi Entropy.
- Reference:
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](
Statistical correlations between locally randomized measurements:
A toolbox for probing entanglement in many-body quantum states - A. Elben, B. Vermersch, C. F. Roos, and P. Zoller, [PhysRevA.99.052323](
)
- Parameters:
shots (int) – Shots of the counts.
counts (list[dict[str, int]]) – Counts from randomized measurement results.
degree (Optional[Union[tuple[int, int], int]]) – The range of partition.
measure (Optional[tuple[int, int]], optional) – The range that implemented the measuring gate. If not specified, then use all qubits. This will affect the range of partition when you not implement the measuring gate on all qubit. Defaults to None.
backend (PostProcessingBackendLabel, optional) – Backend for the post-processing. Defaults to DEFAULT_PROCESS_BACKEND.
workers_num (Optional[int], optional) – Number of multi-processing workers, it will be ignored if backend is Rust. if sets to 1, then disable to using multi-processing; if not specified, then use the number of all cpu counts by os.cpu_count(). This only works for Python and Cython backend. Defaults to None.
pbar (Optional[tqdm.tqdm], optional) – The progress bar API, you can use put a :cls:`tqdm` object here. This function will update the progress bar description. Defaults to None.
- Returns:
A dictionary contains purity, entropy, a list of each overlap, puritySD, degree, actual measure range, bitstring range and more.
- Return type:
entropy_core
¶
Post Processing - Randomized Measure - Entangled Entropy V1 - Core
(qurry.process.randomized_measure.entangled_entropy_v1.entropy_core
)
- qurry.process.randomized_measure.entangled_entropy_v1.entropy_core.entangled_entropy_core(shots: int, counts: list[dict[str, int]], degree: int | tuple[int, int] | None, measure: tuple[int, int] | list[int] | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', multiprocess_pool_size: int | None = None) tuple[dict[int, float] | dict[int, float64], tuple[int, int], tuple[int, int], str, float] [source]¶
The core function of entangled entropy.
- Parameters:
shots (int) – Shots of the experiment on quantum machine.
counts (list[dict[str, int]]) – Counts of the experiment on quantum machine.
degree (Optional[Union[tuple[int, int], int]]) – Degree of the subsystem.
measure (Optional[tuple[int, int]], optional) – Measuring range on quantum circuits. Defaults to None.
backend (PostProcessingBackendLabel, optional) – Backend for the process. Defaults to DEFAULT_PROCESS_BACKEND.
multiprocess_pool_size (Optional[int], optional) – Number of multi-processing workers, it will be ignored if backend is Rust. if sets to 1, then disable to using multi-processing; if not specified, then use the number of all cpu counts by os.cpu_count(). Defaults to None.
- Raises:
ValueError – Get degree neither ‘int’ nor ‘tuple[int, int]’.
ValueError – Measure range does not contain subsystem.
- Returns:
Purity of each cell, Partition range, Measuring range, Message, Time to calculate.
- Return type:
tuple[dict[int, float], tuple[int, int], tuple[int, int], str, float]
- qurry.process.randomized_measure.entangled_entropy_v1.entropy_core.entangled_entropy_core_allrust(shots: int, counts: list[dict[str, int]], degree: int | tuple[int, int] | None, measure: tuple[int, int] | None = None) tuple[dict[int, float], tuple[int, int], tuple[int, int], str, float] [source]¶
The core function of entangled entropy by Rust.
- Parameters:
shots (int) – Shots of the experiment on quantum machine.
counts (list[dict[str, int]]) – Counts of the experiment on quantum machine.
degree (Optional[Union[tuple[int, int], int]]) – Degree of the subsystem.
measure (Optional[tuple[int, int]], optional) – Measuring range on quantum circuits. Defaults to None.
- Raises:
ValueError – Get degree neither ‘int’ nor ‘tuple[int, int]’.
ValueError – Measure range does not contain subsystem.
- Returns:
Purity of each cell, Partition range, Measuring range, Message, Time to calculate.
- Return type:
tuple[dict[int, float], tuple[int, int], tuple[int, int], str, float]
- qurry.process.randomized_measure.entangled_entropy_v1.entropy_core.entangled_entropy_core_pycyrust(shots: int, counts: list[dict[str, int]], degree: int | tuple[int, int] | None, measure: tuple[int, int] | None = None, multiprocess_pool_size: int | None = None, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust') tuple[dict[int, float] | dict[int, float64], tuple[int, int], tuple[int, int], str, float] [source]¶
The core function of entangled entropy by Cython, Python, or Rust for just purity cell part.
- Parameters:
shots (int) – Shots of the experiment on quantum machine.
counts (list[dict[str, int]]) – Counts of the experiment on quantum machine.
degree (Optional[Union[tuple[int, int], int]]) – Degree of the subsystem.
measure (Optional[tuple[int, int]], optional) – Measuring range on quantum circuits. Defaults to None.
multiprocess_pool_size (Optional[int], optional) – Number of multi-processing workers, if sets to 1, then disable to using multi-processing; if not specified, then use the number of all cpu counts by os.cpu_count(). Defaults to None.
backend (PostProcessingBackendLabel, optional) – Backend for the process. Defaults to ‘Cython’.
- Raises:
ValueError – Get degree neither ‘int’ nor ‘tuple[int, int]’.
ValueError – Measure range does not contain subsystem.
- Returns:
- tuple[
Union[dict[int, float], dict[int, np.float64]], tuple[int, int], tuple[int, int], str, float,
- ]:
Purity of each cell, Partition range, Measuring range, Message, Time to calculate.
purity_cell
¶
Post Processing - Randomized Measure - Entangled Entropy V1 - Purity Cell
(qurry.process.randomized_measure.entangled_entropy_v1.purity_cell
)
- qurry.process.randomized_measure.entangled_entropy_v1.purity_cell.purity_cell(idx: int, single_counts: dict[str, int], bitstring_range: tuple[int, int], subsystem_size: int, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust') tuple[int, float | float64] [source]¶
Calculate the purity cell, one of overlap, of a subsystem.
- Parameters:
idx (int) – Index of the cell (counts).
single_counts (dict[str, int]) – Counts measured by the single quantum circuit.
bitstring_range (tuple[int, int]) – The range of the subsystem.
subsystem_size (int) – Subsystem size included.
backend (ExistingProcessBackendLabel, optional) – Backend for the process. Defaults to DEFAULT_PROCESS_BACKEND.
- Returns:
Index, one of overlap purity.
- Return type:
- qurry.process.randomized_measure.entangled_entropy_v1.purity_cell.purity_cell_py(idx: int, single_counts: dict[str, int], bitstring_range: tuple[int, int], subsystem_size: int) tuple[int, float64] [source]¶
Calculate the purity cell, one of overlap, of a subsystem by Python.
- Parameters:
- Returns:
Index, one of overlap purity.
- Return type:
- qurry.process.randomized_measure.entangled_entropy_v1.purity_cell.purity_cell_rust(idx: int, single_counts: dict[str, int], bitstring_range: tuple[int, int], subsystem_size: int) tuple[int, float] [source]¶
Calculate the purity cell, one of overlap, of a subsystem by Rust.
- Parameters:
- Returns:
Index, one of overlap purity.
- Return type:
container
¶
Post Processing - Randomized Measure - Entangled Entropy V1 - Container
(qurry.process.randomized_measure.entangled_entropy_v1.container
)
- class qurry.process.randomized_measure.entangled_entropy_v1.container.ExistingAllSystemSource[source]¶
Existing all system source.
- class qurry.process.randomized_measure.entangled_entropy_v1.container.RandomizedEntangledEntropyComplex[source]¶
The result of the analysis.
- class qurry.process.randomized_measure.entangled_entropy_v1.container.RandomizedEntangledEntropyMitigatedComplex[source]¶
The result of the analysis.
- bitsStringRangeAllSys: tuple[int, int] | list[int]¶
The range of partition on the bitstring of all system.
- errorRate: float64 | float¶
The error rate of the measurement from depolarizing error migigation calculated.
- measure: tuple[str, list[int] | tuple[int, int]]¶
The qubit range of the measurement and text description.
The first element is the text description.
The second element is the qubit range of the measurement.
— - When the measurement is specified, it will be:
>>> ("measure range:", (0, 3))
When the measurement is not specified, it will be:
>>> ("not specified, use all qubits", (0, 3))
When null counts exist, it will be:
>>> ("The following is the index of null counts.", [0, 1, 2, 3])