示例#1
0
 public Qubit(double zeroProbability)
 {
     if (zeroProbability < 0 || zeroProbability > 1)
     {
         throw new ArgumentException("probability should be between 0 and 1 included");
     }
     State         = new QuantumState(zeroProbability, 1 - zeroProbability);
     StateOperator = StateOperator.FromQuantumState(State);
 }
示例#2
0
 public Qubit(Complex zeroAmplitude, Complex oneAmplitude)
 {
     State         = new QuantumState(zeroAmplitude, oneAmplitude);
     StateOperator = StateOperator.FromQuantumState(State);
 }
示例#3
0
 public Qubit(Qubit qubit)
 {
     State         = new QuantumState(qubit.State);
     StateOperator = new StateOperator(qubit.StateOperator);
 }