inquanto-phayes¶
InQuanto Phayes extension.
- class AlgorithmBayesianQPE(phayes_state, k_max=None, error_rate=None, verbose=0)¶
Execute Bayesian QPE algorithm.
This class reproduces the workflow in arXiv:2306.16608.
The Bayesian update part is based on the Quantinuum’s phayes package.
- Parameters:
phayes_state (
PhayesState
) – Initial state as aPhayesState
object.k_max (
Optional
[int
], default:None
) – Cap of the number of repeats of the CTRL-U circuit.error_rate (
Optional
[Callable
[[int
,float
],float
]], default:None
) – Error rate to be used for the noise-aware likelihood.verbose (
int
, default:0
) – Control the verbosity.
- build(protocol)¶
Set the IQPE protocol object.
- Parameters:
protocol (
BaseIterativePhaseEstimation
) – IQPE protocol to be used for handling the circuit.- Returns:
AlgorithmBayesianQPE
– self
- final_pdf(phi)¶
Return the PDF as a function of phase.
- Parameters:
phi (
ndarray
) – Grid representation of the phase in [0, 2) (pytket convention).- Returns:
ndarray
– Probability distribution function.
- final_value()¶
Return the energy estimate.
- property has_updated: bool¶
Indicate if the Bayesian update is performed or not.
It returns
False
if no measurement outcome is available for some reasons such as discarding the measurement outcome by the error detection code. Repeat until success is effectively performed by callingrun()
again.- Returns:
True
if the Bayesian update is performed.
- join(handles_mapping)¶
Retrieve the backend results through the protocol.
- property phayes_state: PhayesState¶
Current PhaseState object.
- run()¶
Run the algorithm.