py_alqorithms.create_xyz_shadow_measurement

py_alqorithms.create_xyz_shadow_measurement(num_qubits, n_measurements=None, max_circuits=None, constant_circuit=None)

Generates circuits for shadow measurements based on specified measurement bases for each qubit.

Each circuit corresponds to a different combination of measurement bases (X, Y, Z, etc.), applied across all qubits. This function iterates over all possible combinations of measurement bases, constructs the circuit for each combination by applying the corresponding unitary transformations, and then stores the circuit along with its unitary matrices.

Parameters:
  • num_qubits (int) -- The number of qubits in the circuit.

  • n_measurement (Optional[int]) -- The number of measurements to perform. Defaults to 1.

  • max_circuits (Optional[int]) -- The maximum number of circuits to generate. Defaults to None, which means all combinations possible.

  • constant_circuit (Optional[Circuit]) -- The constant circuit to use in the measurement.

Returns: - dict: A dictionary where keys are strings representing the combination of measurement bases applied to

each qubit, and values are tuples containing the corresponding quantum circuit and a dictionary of unitary matrices for each qubit.