Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Qubit ¶
type Qubit struct { Zero complex128 One complex128 }
func New ¶
func New(zero complex128, one complex128) Qubit
Creates a new qubit with the coefficients of |0> and |1> as inputs. If it is not normalised, an error will be returned.
func (*Qubit) IsNormalised ¶ added in v0.1.1
func (*Qubit) ProbabilityZero ¶
Returns the probability of the qubit returning zero when measured. This should be used with a random number generator between 0.0 and 1.0 to set the threshold. Below that threshold, 0 is returned, and above it, 1.
Click to show internal directories.
Click to hide internal directories.