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

            return(c.Real == Real && c.Imaginary == Imaginary);
        }
예제 #2
0
파일: Qubit.cs 프로젝트: izaxon/Qubit
 /// <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;
 }
예제 #3
0
 public complex(complex c)
 {
     this.Real      = c.Real;
     this.Imaginary = c.Imaginary;
 }