hadamardยถ

Post-processing for hadamard test

purity_echo_coreยถ

Post Processing - Hadamard Test - Purity/Echo (qurry.process.hadamard_test.purity_echo_core)

qurry.process.hadamard_test.purity_echo_core.purity_echo_core(shots: int, counts: list[dict[str, int]], backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust') float[source]ยถ

Calculate entangled entropy with more information combined. The entropy we compute is the Second Order Rรฉnyi Entropy.

Parameters:
  • shots (int) โ€“ Shots of the experiment on quantum machine.

  • counts (list[dict[str, int]]) โ€“ Counts of the experiment on quantum machine.

Raises:
  • Warning โ€“ Expected โ€˜0โ€™ and โ€˜1โ€™, but there is no such keys

  • ValueError โ€“ The length of counts is not 1.

  • ValueError โ€“ shots does not match sample_shots.

Returns:

Quantity of the experiment.

Return type:

dict[str, float]

qurry.process.hadamard_test.purity_echo_core.purity_echo_core_allrust(shots: int, counts: list[dict[str, int]]) 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.

Raises:
  • ValueError โ€“ Get degree neither โ€˜intโ€™ nor โ€˜tuple[int, int]โ€™.

  • ValueError โ€“ Measure range does not contain subsystem.

Returns:

Purity or Echo of the experiment.

Return type:

float

wavefunction_overlapยถ

Post Processing - Hadamard Test - Wavefunction Overlap (qurry.process.hadamard_test.wavefunction_overlap)

qurry.process.hadamard_test.wavefunction_overlap.hadamard_overlap_echo(shots: int, counts: list[dict[str, int]], backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) dict[str, float][source]ยถ

Calculate overlap echo with more information combined. The echo we compute is the Loschmidt Echo.

Parameters:
  • shots (int) โ€“ Shots of the experiment on quantum machine.

  • counts (list[dict[str, int]]) โ€“ Counts of the experiment on quantum machine.

  • backend (PostProcessingBackendLabel, optional) โ€“ Backend of the postprocessing. Defaults to DEFAULT_PROCESS_BACKEND.

  • pbar (Optional[tqdm.tqdm], optional) โ€“ Progress bar. Defaults to None.

Raises:
  • ValueError โ€“ Get degree neither โ€˜intโ€™ nor โ€˜tuple[int, int]โ€™.

  • ValueError โ€“ Measure range does not contain subsystem.

Returns:

Quantity of the experiment.

Return type:

dict[str, float]

entangled_entropyยถ

Post Processing - Hadamard Test - Entangled Entropy (qurry.process.hadamard_test.entangled_entropy)

qurry.process.hadamard_test.entangled_entropy.hadamard_entangled_entropy(shots: int, counts: list[dict[str, int]], backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) dict[str, float][source]ยถ

Calculate entangled entropy with more information combined. The entropy we compute is the Second Order Rรฉnyi Entropy.

Parameters:
  • shots (int) โ€“ Shots of the experiment on quantum machine.

  • counts (list[dict[str, int]]) โ€“ Counts of the experiment on quantum machine.

  • backend (PostProcessingBackendLabel, optional) โ€“ Backend of the postprocessing. Defaults to DEFAULT_PROCESS_BACKEND.

  • pbar (Optional[tqdm.tqdm], optional) โ€“ Progress bar. Defaults to None.

Raises:
  • ValueError โ€“ Get degree neither โ€˜intโ€™ nor โ€˜tuple[int, int]โ€™.

  • ValueError โ€“ Measure range does not contain subsystem.

Returns:

Quantity of the experiment.

Return type:

dict[str, float]