public static readonly qubit Zero = new qubit(complex.One, complex.Zero); // TODO: correct? public double[][] GetAsMatrix() { return(new double[2][] { new double[] { Alpha.Abs(), 0 }, new double[] { 0, Beta.Abs() } }); }
/// <summary> /// Constructs a qubit. /// </summary> /// <param name="alpha"></param> /// <param name="beta"></param> public qubit(complex alpha, complex beta) { Debug.Assert(Math.Pow(alpha.Abs(), 2) + Math.Pow(beta.Abs(), 2) - 1 < 0.000001); this.Alpha = alpha; this.Beta = beta; }