qiu_quantum_computing.phase_propagator.sample_based_manual
¶
Statevector simulation of the sample-based phase propagation, post-selected on success.
Instead of measuring the phi register, each cycle keeps the part of the state in
which it is |0...0>, i.e. the successful outcome, and renormalizes it. See
sample_based for the protocol.
Functions:
-
phase_propagation_cycle–Simulate one cycle of the protocol, post-selected on its success.
-
phase_propagate_state–Simulate one successful cycle per delta.
-
phase_propagate_state_with_constant_delta–Simulate
num_cyclessuccessful cycles with the same delta. -
phase_propagate_state_with_arbitrary_signal–Simulate the application of
e^(i f(x))for a signalfof one sign.
phase_propagation_cycle
¶
phase_propagation_cycle(psi: Statevector, delta: float, phi: PreparableState) -> tuple[Statevector, float]
Simulate one cycle of the protocol, post-selected on its success.
Parameters:
-
psi(Statevector) –The state of the
psiregister. -
delta(float) –The phase of the cycle.
-
phi(PreparableState) –The preparable state
|phi>.
Returns:
-
Statevector–The normalized state of the
psiregister after a successful cycle, and the -
float–probability of success.
Source code in packages/qiu-quantum-computing/src/qiu_quantum_computing/phase_propagator/sample_based_manual.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
phase_propagate_state
¶
phase_propagate_state(psi_in: Statevector, deltas: NDArray | list[float], phi: PreparableState) -> Statevector
Simulate one successful cycle per delta.
Parameters:
-
psi_in(Statevector) –The initial state of the
psiregister. -
deltas(NDArray | list[float]) –The phase of each cycle.
-
phi(PreparableState) –The preparable state
|phi>.
Returns:
-
Statevector–The state of the
psiregister after all cycles.
Source code in packages/qiu-quantum-computing/src/qiu_quantum_computing/phase_propagator/sample_based_manual.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
phase_propagate_state_with_constant_delta
¶
phase_propagate_state_with_constant_delta(psi_in: Statevector, delta: float, num_cycles: int, phi: PreparableState) -> Statevector
Simulate num_cycles successful cycles with the same delta.
Parameters:
-
psi_in(Statevector) –The initial state of the
psiregister. -
delta(float) –The phase of each cycle.
-
num_cycles(int) –The number of cycles.
-
phi(PreparableState) –The preparable state
|phi>.
Returns:
-
Statevector–The state of the
psiregister after all cycles.
Source code in packages/qiu-quantum-computing/src/qiu_quantum_computing/phase_propagator/sample_based_manual.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
phase_propagate_state_with_arbitrary_signal
¶
phase_propagate_state_with_arbitrary_signal(psi_in: Statevector, signal: SampledSignal, max_delta: float, method: SynthesisMethod = GATE) -> Statevector
Simulate the application of e^(i f(x)) for a signal f of one sign.
Parameters:
-
psi_in(Statevector) –The initial state of the
psiregister. -
signal(SampledSignal) –The real signal
fof one sign, on an axis of2**nsamples. -
max_delta(float) –The maximum phase per cycle.
-
method(SynthesisMethod, default:GATE) –How the preparation of
|phi>is represented in the circuits.
Returns:
-
Statevector–The state of the
psiregister after all cycles.
Source code in packages/qiu-quantum-computing/src/qiu_quantum_computing/phase_propagator/sample_based_manual.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |