public QHadamard(IQBit bit) : base(bit.Probability, bit.State) { //Console.WriteLine($"Applying Hadamard gate to {this}"); //var t = new Complex(Math.Sqrt(0.5), 0); //Probability = 1 / Math.Sqrt(2); //Console.WriteLine($"Applying Hadamard gate to {this}"); //Console.WriteLine(coeff); }
public QNot(IQBit bit) : base(bit.Probability, bit.State) { Console.WriteLine($"Applying Quantum Not to {this}"); /* * x = 1 |0> * not(x) * x = 1 |1> */ if (State == 1) { State = 0; } else { State = 1; } }
private static void PrintState(IQBit bit) { Console.WriteLine("{Probability} |{State}>"); Console.WriteLine(bit); }