AmplitudeEstimation
QuICT.algorithm.quantum_algorithm.AmplitudeEstimation ¶
AmplitudeEstimation(precision_bits: int, work_bits: int, targ_phase_flip: CompositeGate, work_state_prep: CompositeGate, qpe_method: _QpeMethod = 'normal')
Amplitude Estimation Method
Reference
[1]: Brassard, Gilles, Peter Hoyer, Michele Mosca, and Alain Tapp. “Quantum Amplitude Amplification and Estimation,” 305:53-74, 2002. https://doi.org/10.1090/conm/305/05215.
Parameters:
-
precision_bits(int) –Number of qubits for the amplitude.
-
work_bits(int) –Number of qubits required for the target state.
-
targ_phase_flip(CompositeGate) –The oracle for flipping phase of the target state whoes amplitude is about to be estimated.
-
work_state_prep(CompositeGate) –The state preparation gate that generate the state which contains the amplitude to be estimated.
-
qpe_method(str, default:'normal') –Quantum phase estimation implementation to be used when constructing the order finding circuit, choose from "normal" and "iterative".
Source code in QuICT/algorithm/quantum_algorithm/amplitude_estimation/qae.py
circuit ¶
Construct the amplitude estimation circuit.
Return: Circuit, the amplitude estimation circuit.
Source code in QuICT/algorithm/quantum_algorithm/amplitude_estimation/qae.py
decode_to_amplitude_norm
staticmethod
¶
Decode the bit string got sampled from the circuit to norm of the disired amplitude
Parameters:
-
bit_str(str) –the binary string got from running the amplitude estimation.
Returns:
-
float–float, norm of the amplitude.
Source code in QuICT/algorithm/quantum_algorithm/amplitude_estimation/qae.py
decode_to_prob
staticmethod
¶
Decode the bit string got sampled from the circuit to the probability of getting the disired state.
Parameters:
-
bit_str(str) –the binary string got from running the amplitude estimation.
Returns:
-
float–float, probability of getting the disired state.
Source code in QuICT/algorithm/quantum_algorithm/amplitude_estimation/qae.py
run ¶
Run the amplitude estimation circuit and get the sampling result
Parameters:
-
backend(Any, default:StateVectorSimulator(ignore_last_measure=False)) –a backend to run the qpe circuit.
-
shots(int, default:1) –number of times to run the circuit.
Return: Dict[str, int]: a pair representing the sampling result in binary string with its number of count.