Example #1
0
        public QuantumRegisterVector(QuantumRegisterAbstract quantumRegisterAbstract)
        {
            var a = (QuantumRegisterVector)quantumRegisterAbstract;

            this.Vector = a.Vector;
        }
Example #2
0
        // public abstract QuantumRegisterAbstract ProduceRegister(IEnumerable<Complex> enumerable);
        // public abstract QuantumRegisterAbstract ProduceRegister(Vector<Complex> register);

        // public abstract QuantumRegisterAbstract ProduceRegister(params Complex[] array);

        public abstract QuantumRegisterAbstract ProduceRegister(QuantumRegisterAbstract quantumRegisterAbstract);
Example #3
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));
 }
Example #4
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));
 }
Example #5
0
 /*
  * Constructor from probability amplitudes
  */
 public Qubit(Complex zeroAmplitude, Complex oneAmplitude, QuantumRegisterProducerBase producer)
 {
     QuantumRegister = producer.ProduceRegister(zeroAmplitude, oneAmplitude); //new  QuantumRegisterVector(zeroAmplitude, oneAmplitude);
 }
Example #6
0
        public QuantumRegisterArray(QuantumRegisterAbstract quantumRegisterAbstract)
        {
            var a = (QuantumRegisterVector)quantumRegisterAbstract;

            this.Vector = new List <Complex>(a.Vector.ToArray());
        }
Example #7
0
        // public override QuantumRegisterAbstract ProduceRegister(params Complex[] array)
        // {
        // return new QuantumRegisterVector(array);
        // }

        public override QuantumRegisterAbstract ProduceRegister(QuantumRegisterAbstract quantumRegisterAbstract)
        {
            return(new QuantumRegisterVector(quantumRegisterAbstract));
        }