예제 #1
0
 /*
  * Constructor from parts of probability amplitudes
  */
 public Qubit(double zeroAmplitudeReal, double zeroAmplitudeImaginary, double oneAmplitudeReal,
              double oneAmplitudeImaginary, QuantumRegisterProducerBase producer)
 {
     QuantumRegister = producer.ProduceRegister(new Complex(zeroAmplitudeReal, zeroAmplitudeImaginary),
                                                new Complex(oneAmplitudeReal, oneAmplitudeImaginary));
 }
예제 #2
0
 /*
  * Constructor from Bloch sphere coordinates
  */
 public Qubit(double colatitude, double longitude, QuantumRegisterProducerBase producer)
 {
     QuantumRegister = producer.ProduceRegister(Math.Cos(colatitude / 2),
                                                Math.Sin(colatitude / 2) * Mathematics.Numerics.ComplexExp(Complex.ImaginaryOne * longitude));
 }
예제 #3
0
 /*
  * Constructor from probability amplitudes
  */
 public Qubit(Complex zeroAmplitude, Complex oneAmplitude, QuantumRegisterProducerBase producer)
 {
     QuantumRegister = producer.ProduceRegister(zeroAmplitude, oneAmplitude); //new  QuantumRegisterVector(zeroAmplitude, oneAmplitude);
 }