magnet_squareΒΆ

Post-processing for magnetization square

magsq_coreΒΆ

Post Processing - Magnetization Square - Core (qurry.process.magnet_square.magsq_core)

qurry.process.magnet_square.magsq_core.magnetic_square_core(shots: int, counts: list[dict[str, int]], num_qubits: int, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust') tuple[float | float64, dict[int, float] | dict[int, float64], float][source]ΒΆ

The core function of Magnetization square by Python.

Parameters:
  • shots (int) – Shots of the experiment on quantum machine.

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

  • num_qubits (int) – Number of qubits.

  • backend (PostProcessingBackendLabel, optional) – Post Processing backend. Defaults to DEFAULT_PROCESS_BACKEND.

Returns:

Magnetization square, magnetization square cell, time taken.

Return type:

tuple[Union[float, np.float64], Union[dict[int, float], dict[int, np.float64]], float]

qurry.process.magnet_square.magsq_core.magsq_cell_py(idx: int, single_counts: dict[str, int], shots: int) tuple[int, float64][source]ΒΆ

Calculate the magnitudes square cell

Parameters:
  • idx (int) – Index of the cell (counts).

  • single_counts (dict[str, int]) – Single counts of the cell.

  • shots (int) – Shots of the experiment on quantum machine.

Returns:

Index, one of magnitudes square.

Return type:

tuple[int, np.float64]

qurry.process.magnet_square.magsq_core.magsq_cell_py_deprecated(idx: int, single_counts: dict[str, int], shots: int) tuple[int, float64][source]ΒΆ

Calculate the magnitudes square cell

Parameters:
  • idx (int) – Index of the cell (counts).

  • single_counts (dict[str, int]) – Single counts of the cell.

  • shots (int) – Shots of the experiment on quantum machine.

Returns:

Index, one of magnitudes square.

Return type:

tuple[int, np.float64]

qurry.process.magnet_square.magsq_core.magsq_cell_wrapper(arguments: tuple[int, dict[str, int], int]) tuple[int, float64][source]ΒΆ

Wrapper for the magnetic square cell.

Parameters:

arguments (tuple[int, dict[str, int], int, PostProcessingBackendLabel]) – The arguments for the magnetic square cell. - idx (int): Index of the cell (counts). - single_counts (dict[str, int]): Single counts of the cell. - shots (int): Shots of the experiment on quantum machine.

Returns:

Index, one of magnitudes square.

Return type:

tuple[int, np.float64]

qurry.process.magnet_square.magsq_core.z_dir_magnetic_square_core(shots: int, single_counts: dict[str, int], num_qubits: int, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust') tuple[float | float64, dict[int, float] | dict[int, float64], float][source]ΒΆ

The core function of Z direction Magnetization square by Python.

Parameters:
  • shots (int) – Shots of the experiment on quantum machine.

  • single_counts (dict[str, int]) – Single count.

  • num_qubits (int) – Number of qubits.

  • backend (PostProcessingBackendLabel, optional) – Post Processing backend. Defaults to DEFAULT_PROCESS_BACKEND.

Returns:

Magnetization square, magnetization square cell, time taken.

Return type:

tuple[Union[float, np.float64], Union[dict[int, float], dict[int, np.float64]], float]

magnet_squareΒΆ

Post Processing - Magnetization Square - Magnetization Square (qurry.process.magnet_square.magnet_square)

class qurry.process.magnet_square.magnet_square.MagnetSquare[source]ΒΆ

Magnetization Square type.

magnet_square: float | float64ΒΆ

Magnetization Square.

magnet_square_cells: dict[int, float] | dict[int, float64]ΒΆ

Magnetization Square cells.

taking_time: floatΒΆ

Taking time.

qurry.process.magnet_square.magnet_square.magnet_square(shots: int, counts: list[dict[str, int]], num_qubits: int, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) MagnetSquare[source]ΒΆ

Calculate the magnet square.

Parameters:
  • shots (int) – Number of shots.

  • counts (list[dict[str, int]]) – List of counts.

  • num_qubits (int) – Number of qubits.

  • backend (Optional[PostProcessingBackendLabel], optional) – Backend to use. Defaults to None.

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

Returns:

Magnetization Square.

Return type:

MagnetSquare

qurry.process.magnet_square.magnet_square.z_dir_magnet_square(shots: int, single_counts: dict[str, int], num_qubits: int, backend: Literal['Cython', 'Rust', 'Python'] | str = 'Rust', pbar: tqdm | None = None) MagnetSquare[source]ΒΆ

Calculate the magnet square for Z direction.

Signle counts is only working for Z direction.

Parameters:
  • shots (int) – Number of shots.

  • single_counts (dict[str, int]) – Single count.

  • num_qubits (int) – Number of qubits.

  • backend (Optional[PostProcessingBackendLabel], optional) – Backend to use. Defaults to None.

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

Returns:

Magnetization Square.

Return type:

MagnetSquare