コード例 #1
0
ファイル: Devices.cs プロジェクト: rombolshak/Requc
 public static void Attenuator(QuantumState state, ProtocolParams protocolParams)
 {
     state.Timeslot[0] = (state.Timeslot[0] - protocolParams.LaserPhotonNumberMin)/
                         (protocolParams.LaserPhotonNumberMax - protocolParams.LaserPhotonNumberMin);
     state.Timeslot[1] = (state.Timeslot[1] - protocolParams.LaserPhotonNumberMin)/
                         (protocolParams.LaserPhotonNumberMax - protocolParams.LaserPhotonNumberMin);
     state.Timeslot[2] = (state.Timeslot[2] - protocolParams.LaserPhotonNumberMin) /
                         (protocolParams.LaserPhotonNumberMax - protocolParams.LaserPhotonNumberMin);
 }
コード例 #2
0
ファイル: Devices.cs プロジェクト: rombolshak/Requc
        public static void BeamSplit(QuantumState topState, QuantumState bottomState)
        {
            var sqrt2 = Math.Sqrt(2);
            var sum = new ObservableCollection<Complex>(new[]
                {
                    (topState.Timeslot[0] + bottomState.Timeslot[0])/sqrt2,
                    (topState.Timeslot[1] + bottomState.Timeslot[1])/sqrt2,
                    (topState.Timeslot[2] + bottomState.Timeslot[2])/sqrt2
                });
            var sub = new ObservableCollection<Complex>(new[]
                {
                    (topState.Timeslot[0] - bottomState.Timeslot[0])/sqrt2,
                    (topState.Timeslot[1] - bottomState.Timeslot[1])/sqrt2,
                    (topState.Timeslot[2] - bottomState.Timeslot[2])/sqrt2
                });

            topState.Timeslot = sum;
            bottomState.Timeslot = sub;
        }
コード例 #3
0
ファイル: Devices.cs プロジェクト: rombolshak/Requc
 public static void PhaseShift(QuantumState state, int timeslot, double phase)
 {
     state.Timeslot[timeslot] *= Complex.Exp(Complex.ImaginaryOne * phase);
 }
コード例 #4
0
ファイル: Devices.cs プロジェクト: rombolshak/Requc
 public static void Delay(QuantumState state)
 {
     state.Timeslot[2] = state.Timeslot[1];
     state.Timeslot[1] = state.Timeslot[0];
     state.Timeslot[0] = 0;
 }