public override bool Equals(object obj) { complex c = (complex)obj; return(c.Real == Real && c.Imaginary == Imaginary); }
/// <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; }
public complex(complex c) { this.Real = c.Real; this.Imaginary = c.Imaginary; }