Esempio n. 1
0
        internal void AddNewQubit()
        {
            int        newRow   = _qubits.Count;
            QubitModel newQubit = QubitModel.Zero;

            _qubits.Add(newQubit);
        }
Esempio n. 2
0
        public void ChangeValue(object parameter)
        {
            QubitModel old = Value;

            if (old == QubitModel.Zero)
            {
                Value = QubitModel.One;
            }
            else
            {
                Value = QubitModel.Zero;
            }
            _model.Registers[_registerIndex].ResetQubit(_rowIndex, old);
        }
Esempio n. 3
0
 public void ResetQubit(int position, QubitModel oldValue)
 {
     if (oldValue == QubitModel.Unknown)
     {
         for (int i = 0; i < _qubits.Count; i++)
         {
             QubitModel q = _qubits[i];
             if (q == QubitModel.Unknown)
             {
                 _qubits[i] = QubitModel.Zero;
             }
         }
         UpdateInitStates();
     }
     else
     {
         UpdateInitStates(position);
     }
 }
Esempio n. 4
0
 public void ChangeValue(object parameter)
 {
     QubitModel old = Value;
     if (old == QubitModel.Zero)
     {
         Value = QubitModel.One;
     }
     else
     {
         Value = QubitModel.Zero;
     }
     _model.Registers[_registerIndex].ResetQubit(_rowIndex, old);
 }
Esempio n. 5
0
        internal void InsertQubit(int position)
        {
            QubitModel newQubit = QubitModel.Zero;

            _qubits.Insert(position, newQubit);
        }
 public void ResetQubit(int position, QubitModel oldValue)
 {
     if (oldValue == QubitModel.Unknown)
     {
         for (int i = 0; i < _qubits.Count; i++)
         {
             QubitModel q = _qubits[i];
             if (q == QubitModel.Unknown)
             {
                 _qubits[i] = QubitModel.Zero;
             }
         }
         UpdateInitStates();
     }
     else
     {
         UpdateInitStates(position);
     }
 }