Init with probabilities of individual qubits being 0

Suppose that one needs to have an initial state

$\displaystyle \vert\psi_{ini}\rangle=\bigotimes_{i=1}^n(\sqrt{p_i}\vert_i\rangle+\sqrt{1-p_i}\vert 1_i\rangle),$ (3)

where $ 0\le p_i\le 1, p_i\in\mathbf{R}$. This can be done by the command
initpb $ p_1$ $ p_2$ ... $ p_n$;
For instance, ``initpb 0.6 0.5;'' sets the initial state to $ \begin{pmatrix}\sqrt{0.6}\\ \sqrt{0.4}\end{pmatrix}\otimes \begin{pmatrix}\sqrt{0.5}\\ \sqrt{0.5}\end{pmatrix}$.



root
2004-06-15