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