Beispiel #1
0
        public override bool Equals(object obj)
        {
            complex c = (complex)obj;

            return(c.Real == Real && c.Imaginary == Imaginary);
        }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 public complex(complex c)
 {
     this.Real      = c.Real;
     this.Imaginary = c.Imaginary;
 }