Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 3
0
 /*
  * Constructor from probability amplitudes
  */
 public Qubit(Complex zeroAmplitude, Complex oneAmplitude, QuantumRegisterProducerBase producer)
 {
     QuantumRegister = producer.ProduceRegister(zeroAmplitude, oneAmplitude); //new  QuantumRegisterVector(zeroAmplitude, oneAmplitude);
 }