workbench_algorithms.subroutines.prepare_khot
Qubricks for the Clock State preparation.
PrepareClockState
Bases: Qubrick
Prepares a clock state.
Example
The output state will be of the form \(\sqrt{p_0}|000\rangle + \sqrt{p_1}|100\rangle + \sqrt{p_2}|110\rangle + \sqrt{p_3}|111\rangle\).
The ket-states should be understood as a unary representation of an integer. For example, \(|1110\rangle\) is 3 in decimal \(|1000\rangle\) is 1 in decimal.
Note
The controlled version only ensures \(\text{c-PREP}|+\rangle|0\rangle^{\otimes n} = |0\rangle|0\rangle^{\otimes n}+|1\rangle \text{PREP}|0\rangle^{\otimes n}\) (a.k.a. if the input state is not zero, there is still an action of this Qubrick).
compute
Prepare the clock state according to given probabilities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
Qubits
|
Target qubits. |
required |
probs
|
list
|
List of probability, such that the output state is of the form \(\sqrt{p_0}|000\rangle + \sqrt{p_1}|100\rangle + \sqrt{p_2}|110\rangle + \sqrt{p_3}|111\rangle\). |
required |
ctrl
|
(Qubits, int)
|
Control register. Default to 0. |
0
|
PrepareWStatePowerTwo
Bases: Qubrick
Prepares a W state for power of two target size.
Note
The controlled version only ensures \(\text{c-PREP}|+\rangle|0\rangle^{\otimes n} = |0\rangle|0\rangle^{\otimes n} + |1\rangle\text{PREP}|0\rangle^{\otimes 2^n}\) (a.k.a. if the input state is not zero, there is still an action of this Qubrick).
PrepareWState
Bases: Qubrick
Prepares a W state.
Note
The controlled version only ensures \(\text{c-PREP}|+\rangle|0\rangle^{\otimes n} = |0\rangle|0\rangle^{\otimes n} + |1\rangle\text{PREP}|0\rangle^{\otimes n}\) (a.k.a. if the input state is not zero, there is still an action of this Qubrick).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
khot_prep
|
Qubrick
|
Qubrick to implement a Clock state. |
None
|
wpower2_prep
|
Qubrick
|
Qubrick to prepare a W state over a power-of-two number of amplitudes. |
None
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|