Esempio n. 1
0
        public void MakeComposite(string name, List <Gate> toGroup)
        {
            Delete();

            RegisterPartModel target = new RegisterPartModel()
            {
                Register = null,
                Offset   = 0,
                Width    = toGroup.Select <Gate, int>(x => x.End).Max() + 1
            };
            CompositeGate cg = new CompositeGate(name, target);

            foreach (StepModel step in _steps)
            {
                for (int j = 0; j < step.Gates.Count; j++)
                {
                    Gate       oldGate = step.Gates[j];
                    CustomGate custom  = oldGate as CustomGate;
                    if (custom != null && custom.FunctionName.Equals(name))
                    {
                        for (int k = oldGate.Begin; k <= oldGate.End; k++)
                        {
                            RegisterRefModel gateRef = GetRefFromOffset(k);
                            Gate             newGate = new EmptyGate(gateRef);
                            step.SetGate(newGate);
                        }
                        Gate replacement = PasteGate(cg, oldGate.Begin);
                        if (step.HasPlace(replacement.Begin, replacement.End))
                        {
                            step.SetGate(replacement);
                        }
                    }
                    j = oldGate.End;
                }
            }

            _compositeGates[name] = toGroup;

            //CompositeGate cg = new CompositeGate(name, toGroup, target);

            Gate toPaste = PasteGate(cg, _selectedItems.Value.BeginRow);

            bool notPasted = true;
            int  i         = _selectedItems.Value.BeginColumn;

            while (notPasted && i <= _selectedItems.Value.EndColumn)
            {
                if (_steps[i].HasPlace(toPaste.Begin, toPaste.End))
                {
                    _steps[i].SetGate(toPaste);
                    notPasted = false;
                }
                i++;
            }
            if (notPasted)
            {
                InsertStepLeft(_selectedItems.Value.BeginColumn);
                _steps[_selectedItems.Value.BeginColumn].SetGate(toPaste);
            }
        }
Esempio n. 2
0
 public MultiControlledGate(RegisterRefModel target, RegisterRefModel control, params RegisterRefModel[] restControls)
 {
     _controls    = new RegisterRefModel[restControls.Length + 1];
     _controls[0] = control;
     Array.Copy(restControls, 0, _controls, 1, restControls.Length);
     _target = target;
 }
Esempio n. 3
0
        public void DeleteRegister(int registerIndex)
        {
            if (_currentStep != 0)
            {
                return;
            }

            SelectedItems = null;

            RegisterModel reg       = _registers[registerIndex];
            int           regBegin  = reg.OffsetToRoot;
            int           regEnd    = reg.OffsetToRoot + reg.Qubits.Count - 1;
            int           regLength = reg.Qubits.Count;

            foreach (StepModel step in Steps)
            {
                Gate firstOld = step.Gates[regBegin];
                if (firstOld.Begin < regBegin)
                {
                    for (int j = firstOld.Begin; j <= firstOld.End; j++)
                    {
                        RegisterRefModel gateRef = GetRefFromOffset(j);
                        Gate             newGate = new EmptyGate(gateRef);
                        step.SetGate(newGate);
                    }
                }
                Gate lastOld = step.Gates[regEnd];
                if (lastOld.End > regEnd)
                {
                    for (int j = lastOld.Begin; j <= lastOld.End; j++)
                    {
                        RegisterRefModel gateRef = GetRefFromOffset(j);
                        Gate             newGate = new EmptyGate(gateRef);
                        step.SetGate(newGate);
                    }
                }

                for (int i = 0; i < regLength; i++)
                {
                    step.Gates.RemoveAt(regBegin);
                }
            }

            int k = 0;

            for (; k < registerIndex; k++)
            {
                _registers[k].IncrementOffset(-regLength);
            }
            k++;
            for (; k < _registers.Count; k++)
            {
                _registers[k].UpdateIndex(k - 1);
            }

            _registers.RemoveAt(registerIndex);
        }
Esempio n. 4
0
        public override Gate Copy(int referenceBeginRow)
        {
            RegisterRefModel targetRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _row.OffsetToRoot - referenceBeginRow
            };

            return(new EmptyGate(targetRef));
        }
Esempio n. 5
0
        private ParametricGate PasteParametricGate(ParametricGate gate, int referenceBeginRow)
        {
            Func <RegisterRefModel, RegisterRefModel> pasteRegRef = rrm =>
            {
                return(GetRefFromOffset(rrm.OffsetToRoot + referenceBeginRow));
            };

            Func <RegisterPartModel, RegisterPartModel> pasteRegPart = rpm =>
            {
                RegisterRefModel beginRef = GetRefFromOffset(rpm.OffsetToRoot + referenceBeginRow);
                int width = Math.Min(beginRef.Register.Qubits.Count - beginRef.Offset, rpm.Width);

                return(new RegisterPartModel()
                {
                    Register = beginRef.Register,
                    Offset = beginRef.Offset,
                    Width = width
                });
            };

            object[] parameters = gate.Parameters;
            object[] newPars    = new object[parameters.Length];
            for (int i = 0; i < parameters.Length; i++)
            {
                if (parameters[i].GetType() == typeof(RegisterRefModel))
                {
                    newPars[i] = pasteRegRef((RegisterRefModel)parameters[i]);
                }
                else if (parameters[i].GetType() == typeof(RegisterPartModel))
                {
                    newPars[i] = pasteRegPart((RegisterPartModel)parameters[i]);
                }
                else if (parameters[i].GetType() == typeof(RegisterRefModel[]))
                {
                    newPars[i] = (parameters[i] as RegisterRefModel[])
                                 .Select <RegisterRefModel, RegisterRefModel>(x => pasteRegRef(x)).ToArray();
                }
                else if (parameters[i].GetType() == typeof(RegisterPartModel[]))
                {
                    newPars[i] = (parameters[i] as RegisterPartModel[])
                                 .Select <RegisterPartModel, RegisterPartModel>(x => pasteRegPart(x)).ToArray();
                }
                else
                {
                    newPars[i] = parameters[i];
                }
            }
            ParametricGate cg = new ParametricGate(gate.Method, gate.ComputationMethod,
                                                   gate.InverseMethod, gate.MethodCode, newPars);

            return(cg);
        }
Esempio n. 6
0
 public MeasureGate(RegisterRefModel beginRow, RegisterRefModel endRow)
 {
     if (beginRow.OffsetToRoot > endRow.OffsetToRoot)
     {
         _beginRow = endRow;
         _endRow   = beginRow;
     }
     else
     {
         _beginRow = beginRow;
         _endRow   = endRow;
     }
 }
Esempio n. 7
0
        public override Gate Copy(int referenceBeginRow)
        {
            RegisterRefModel targetRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _target.OffsetToRoot - referenceBeginRow
            };
            RegisterRefModel controlRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _control.OffsetToRoot - referenceBeginRow
            };

            return(new CNotGate(targetRef, controlRef));
        }
Esempio n. 8
0
        public override Gate Copy(int referenceBeginRow)
        {
            RegisterRefModel beginRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _beginRow.OffsetToRoot - referenceBeginRow
            };
            RegisterRefModel endRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _endRow.OffsetToRoot - referenceBeginRow
            };

            return(new MeasureGate(beginRef, endRef));
        }
Esempio n. 9
0
        protected Tuple <RegisterRefModel, RegisterRefModel[]> CopyRefs(int referenceBeginRow)
        {
            RegisterRefModel targetRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _target.OffsetToRoot - referenceBeginRow
            };

            RegisterRefModel[] controls = _controls.Select <RegisterRefModel, RegisterRefModel>(x =>
                                                                                                new RegisterRefModel()
            {
                Register = null, Offset = x.OffsetToRoot - referenceBeginRow
            })
                                          .ToArray <RegisterRefModel>();

            return(new Tuple <RegisterRefModel, RegisterRefModel[]>(targetRef, controls));
        }
Esempio n. 10
0
        public void DeleteQubit(int registerIndex, int row)
        {
            if (_currentStep != 0)
            {
                return;
            }

            SelectedItems = null;

            RegisterModel reg          = _registers[registerIndex];
            int           offsetToRoot = reg.OffsetToRoot + row;

            foreach (StepModel step in Steps)
            {
                Gate oldGate = step.Gates[offsetToRoot];
                if (oldGate.Name != GateName.Empty)
                {
                    for (int j = oldGate.Begin; j <= oldGate.End; j++)
                    {
                        RegisterRefModel gateRef = GetRefFromOffset(j);
                        Gate             newGate = new EmptyGate(gateRef);
                        step.SetGate(newGate);
                    }
                }

                for (int i = offsetToRoot + 1; i < reg.OffsetToRoot + reg.Qubits.Count; i++)
                {
                    step.Gates[i].IncrementRow(reg, row, -1);
                    i = step.Gates[i].End + 1;
                }

                //step.Gates.RemoveAt(offsetToRoot);
            }

            reg.Qubits.RemoveAt(row);

            for (int i = 0; i < registerIndex; i++)
            {
                _registers[i].IncrementOffset(-1);
            }

            foreach (StepModel step in Steps)
            {
                step.Gates.RemoveAt(offsetToRoot);
            }
        }
Esempio n. 11
0
        protected Tuple <RegisterRefModel, RegisterRefModel?> CopyRefs(int referenceBeginRow)
        {
            RegisterRefModel targetRef = new RegisterRefModel()
            {
                Register = null,
                Offset   = _target.OffsetToRoot - referenceBeginRow
            };
            RegisterRefModel?controlRef = null;

            if (_control.HasValue)
            {
                controlRef = new RegisterRefModel()
                {
                    Register = null,
                    Offset   = _control.Value.OffsetToRoot - referenceBeginRow
                };
            }
            return(new Tuple <RegisterRefModel, RegisterRefModel?>(targetRef, controlRef));
        }
Esempio n. 12
0
        private void CutCopy(bool cut)
        {
            if (_selectedItems.HasValue)
            {
                _clipboard = new List <List <Gate> >();

                _clipboardSelection = new Selection(
                    0,
                    _selectedItems.Value.RowSpan - 1,
                    0,
                    _selectedItems.Value.ColumnSpan - 1);

                for (int i = _selectedItems.Value.BeginColumn; i <= _selectedItems.Value.EndColumn; i++)
                {
                    List <Gate> current = new List <Gate>();
                    _clipboard.Add(current);

                    for (int j = _selectedItems.Value.BeginRow; j <= _selectedItems.Value.EndRow; j++)
                    {
                        if ((_steps[i].Gates[j].Begin >= _selectedItems.Value.BeginRow) &&
                            (_steps[i].Gates[j].End <= _selectedItems.Value.EndRow))
                        {
                            Gate oldGate = _steps[i].Gates[j];

                            current.Add(oldGate.Copy(_selectedItems.Value.BeginRow));

                            if (cut && oldGate.Name != GateName.Empty)
                            {
                                for (; j <= oldGate.End; j++)
                                {
                                    RegisterRefModel gateRef = GetRefFromOffset(j);
                                    Gate             newGate = new EmptyGate(gateRef);
                                    _steps[i].SetGate(newGate);
                                }
                            }
                            j = oldGate.End;
                        }
                    }
                }
            }
        }
Esempio n. 13
0
 public MeasureGate(RegisterRefModel row)
 {
     _beginRow = row;
     _endRow   = row;
 }
Esempio n. 14
0
        public void Delete()
        {
            if (_selectedItems.HasValue)
            {
                if (_selectedItems.Value.RowSpan == 1 && _selectedItems.Value.ColumnSpan == 1)
                {
                    int  column  = _selectedItems.Value.BeginColumn;
                    int  row     = _selectedItems.Value.BeginRow;
                    Gate oldGate = _steps[column].Gates[row];
                    if (oldGate.Name != GateName.Empty)
                    {
                        for (int i = oldGate.Begin; i <= oldGate.End; i++)
                        {
                            RegisterRefModel gateRef = GetRefFromOffset(i);
                            Gate             newGate = new EmptyGate(gateRef);
                            _steps[column].SetGate(newGate);
                        }

                        if (oldGate is MultiControlledGate)
                        {
                            MultiControlledGate mcg    = oldGate as MultiControlledGate;
                            RegisterRefModel    rowRef = GetRefFromOffset(row);
                            if (mcg.Controls.Contains <RegisterRefModel>(rowRef))
                            {
                                RegisterRefModel[] toRemove    = new RegisterRefModel[] { rowRef };
                                RegisterRefModel[] newControls = mcg.Controls.Except <RegisterRefModel>(toRemove).ToArray();
                                Gate toAdd = null;
                                if (oldGate.Name == GateName.PhaseKick)
                                {
                                    PhaseKickGate pk = oldGate as PhaseKickGate;
                                    toAdd = new PhaseKickGate(pk.Gamma, pk.Target, newControls);
                                }
                                else if (oldGate.Name == GateName.CPhaseShift)
                                {
                                    CPhaseShiftGate cps = oldGate as CPhaseShiftGate;
                                    toAdd = new CPhaseShiftGate(cps.Dist, cps.Target, newControls);
                                }
                                else if (oldGate.Name == GateName.InvCPhaseShift)
                                {
                                    InvCPhaseShiftGate icps = oldGate as InvCPhaseShiftGate;
                                    toAdd = new InvCPhaseShiftGate(icps.Dist, icps.Target, newControls);
                                }
                                else // Toffoli
                                {
                                    if (newControls.Length > 1)
                                    {
                                        toAdd = new ToffoliGate(oldGate.Target, newControls);
                                    }
                                    else
                                    {
                                        toAdd = new CNotGate(oldGate.Target, newControls[0]);
                                    }
                                }
                                _steps[column].SetGate(toAdd);
                            }
                        }
                        else if (oldGate.Name == GateName.CNot)
                        {
                            if (oldGate.Control.Value.OffsetToRoot == row)
                            {
                                Gate toAdd = new SigmaXGate(oldGate.Target);
                                _steps[column].SetGate(toAdd);
                            }
                        }
                        else if (oldGate is SingleGate)
                        {
                            SingleGate sg = oldGate as SingleGate;
                            if (sg.Control.HasValue)
                            {
                                if (sg.Control.Value.OffsetToRoot == row)
                                {
                                    Gate toAdd = null;
                                    switch (sg.Name)
                                    {
                                    case GateName.Hadamard:
                                        toAdd = new HadamardGate(sg.Target);
                                        break;

                                    case GateName.PhaseScale:
                                        toAdd = new PhaseScaleGate((sg as PhaseScaleGate).Gamma, sg.Target);
                                        break;

                                    case GateName.RotateX:
                                        toAdd = new RotateXGate((sg as RotateXGate).Gamma, sg.Target);
                                        break;

                                    case GateName.RotateY:
                                        toAdd = new RotateYGate((sg as RotateYGate).Gamma, sg.Target);
                                        break;

                                    case GateName.RotateZ:
                                        toAdd = new RotateZGate((sg as RotateZGate).Gamma, sg.Target);
                                        break;

                                    case GateName.SigmaX:
                                        toAdd = new SigmaXGate(sg.Target);
                                        break;

                                    case GateName.SigmaY:
                                        toAdd = new SigmaYGate(sg.Target);
                                        break;

                                    case GateName.SigmaZ:
                                        toAdd = new SigmaZGate(sg.Target);
                                        break;

                                    case GateName.SqrtX:
                                        toAdd = new SqrtXGate(sg.Target);
                                        break;

                                    case GateName.Unitary:
                                        toAdd = new UnitaryGate((sg as UnitaryGate).Matrix, sg.Target);
                                        break;

                                    default:
                                        break;
                                    }
                                    _steps[column].SetGate(toAdd);
                                }
                            }
                        }
                    }
                }
                else
                {
                    for (int i = _selectedItems.Value.BeginColumn; i <= _selectedItems.Value.EndColumn; i++)
                    {
                        for (int j = _selectedItems.Value.BeginRow; j <= _selectedItems.Value.EndRow; j++)
                        {
                            Gate oldGate = _steps[i].Gates[j];

                            for (int k = oldGate.Begin; k <= oldGate.End; k++)
                            {
                                RegisterRefModel gateRef = GetRefFromOffset(k);
                                Gate             newGate = new EmptyGate(gateRef);
                                _steps[i].SetGate(newGate);
                            }
                            j = oldGate.End;
                        }
                    }
                }
            }
        }
Esempio n. 15
0
        public void Paste()
        {
            if (_selectedItems.HasValue)
            {
                int clickedColumn = _selectedItems.Value.BeginColumn;
                int clickedRow    = _selectedItems.Value.EndRow;

                if (_clipboard != null)
                {
                    int endColumn = clickedColumn + _clipboardSelection.Value.ColumnSpan - 1;
                    int beginRow  = clickedRow - _clipboardSelection.Value.RowSpan + 1;

                    int rightColumn = Math.Min(endColumn, _steps.Count - 1);
                    int bottomRow   = Math.Max(beginRow, 0);

                    int newUpperRow = bottomRow + _clipboardSelection.Value.RowSpan - 1;

                    // remove old gates
                    for (int i = clickedColumn; i <= rightColumn; i++)
                    {
                        Gate beginGate = _steps[i].Gates[bottomRow];
                        if (beginGate.Begin < bottomRow)
                        {
                            for (int j = beginGate.Begin; j <= beginGate.End; j++)
                            {
                                RegisterRefModel gateRef = GetRefFromOffset(j);
                                Gate             newGate = new EmptyGate(gateRef);
                                _steps[i].SetGate(newGate);
                            }
                        }
                        Gate endGate = _steps[i].Gates[clickedRow];
                        if (endGate.End > clickedRow)
                        {
                            for (int j = endGate.Begin; j <= endGate.End; j++)
                            {
                                RegisterRefModel gateRef = GetRefFromOffset(j);
                                Gate             newGate = new EmptyGate(gateRef);
                                _steps[i].SetGate(newGate);
                            }
                        }
                    }

                    // make place, if it was too little
                    for (int i = rightColumn; i < endColumn; i++)
                    {
                        InsertStepRight(i);
                    }
                    for (int i = bottomRow; i > beginRow; i--)
                    {
                        InsertQubitBelow(_registers.Count - 1, 0);
                    }

                    // paste
                    for (int i = 0; i < _clipboard.Count; i++)
                    {
                        foreach (Gate oldGate in _clipboard[i])
                        {
                            Gate newGate = PasteGate(oldGate, bottomRow);
                            _steps[i + clickedColumn].SetGate(newGate);
                        }
                    }

                    // and move selection
                    SelectedItems = new Selection
                                        (bottomRow,
                                        newUpperRow,
                                        clickedColumn,
                                        endColumn);
                }
            }
        }
Esempio n. 16
0
 public PhaseScaleGate(double gamma, RegisterRefModel target, RegisterRefModel?control = null)
     : base(gamma, target, control)
 {
 }
Esempio n. 17
0
 public SigmaXGate(RegisterRefModel target)
     : base(target)
 {
 }
Esempio n. 18
0
        private Gate PasteGate(Gate gate, int referenceBeginRow)
        {
            RegisterRefModel targetRef  = GetRefFromOffset(gate.Target.OffsetToRoot + referenceBeginRow);
            RegisterRefModel?controlRef = null;

            if (gate.Control.HasValue)
            {
                controlRef = GetRefFromOffset(gate.Control.Value.OffsetToRoot + referenceBeginRow);
            }

            switch (gate.Name)
            {
            case GateName.CNot:
                return(new CNotGate(targetRef, controlRef.Value));

            case GateName.Parametric:
                return(PasteParametricGate(gate as ParametricGate, referenceBeginRow));

            case GateName.Composite:
                CompositeGate    cg         = gate as CompositeGate;
                RegisterRefModel partEndRef = GetRefFromOffset(cg.TargetRegister.EndOffsetToRoot + referenceBeginRow);
                if (partEndRef.Register.OffsetToRoot == targetRef.Register.OffsetToRoot)
                {
                    RegisterPartModel target = new RegisterPartModel()
                    {
                        Register = targetRef.Register,
                        Offset   = targetRef.Offset,
                        Width    = cg.TargetRegister.Width
                    };
                    return(new CompositeGate(cg.FunctionName, target));
                }
                else
                {
                    RegisterPartModel target = new RegisterPartModel()
                    {
                        Register = null,
                        Offset   = cg.TargetRegister.Offset + referenceBeginRow,
                        Width    = cg.TargetRegister.Width
                    };
                    return(new CompositeGate(cg.FunctionName, target));
                }

            case GateName.CPhaseShift:
                CPhaseShiftGate    cps      = gate as CPhaseShiftGate;
                RegisterRefModel[] controls = cps.Controls.Select <RegisterRefModel, RegisterRefModel>(x =>
                                                                                                       GetRefFromOffset(x.OffsetToRoot + referenceBeginRow)).ToArray <RegisterRefModel>();
                return(new CPhaseShiftGate(cps.Dist, targetRef, controls));

            case GateName.Empty:
                return(new EmptyGate(targetRef));

            case GateName.Hadamard:
                return(new HadamardGate(targetRef, controlRef));

            case GateName.InvCPhaseShift:
                InvCPhaseShiftGate icps      = gate as InvCPhaseShiftGate;
                RegisterRefModel[] icontrols = icps.Controls.Select <RegisterRefModel, RegisterRefModel>(x =>
                                                                                                         GetRefFromOffset(x.OffsetToRoot + referenceBeginRow)).ToArray <RegisterRefModel>();
                return(new InvCPhaseShiftGate(icps.Dist, targetRef, icontrols));

            case GateName.Measure:
                MeasureGate      mg       = gate as MeasureGate;
                RegisterRefModel beginRef = GetRefFromOffset(mg.Begin + referenceBeginRow);
                RegisterRefModel endRef   = GetRefFromOffset(mg.End + referenceBeginRow);
                return(new MeasureGate(beginRef, endRef));

            case GateName.PhaseKick:
                PhaseKickGate      pk        = gate as PhaseKickGate;
                RegisterRefModel[] controls1 = pk.Controls.Select <RegisterRefModel, RegisterRefModel>(x =>
                                                                                                       GetRefFromOffset(x.OffsetToRoot + referenceBeginRow)).ToArray <RegisterRefModel>();
                return(new PhaseKickGate(pk.Gamma, targetRef, controls1));

            case GateName.PhaseScale:
                PhaseScaleGate ps = gate as PhaseScaleGate;
                return(new PhaseScaleGate(ps.Gamma, targetRef, controlRef));

            case GateName.RotateX:
                RotateXGate rx = gate as RotateXGate;
                return(new RotateXGate(rx.Gamma, targetRef, controlRef));

            case GateName.RotateY:
                RotateYGate ry = gate as RotateYGate;
                return(new RotateYGate(ry.Gamma, targetRef, controlRef));

            case GateName.RotateZ:
                RotateZGate rz = gate as RotateZGate;
                return(new RotateZGate(rz.Gamma, targetRef, controlRef));

            case GateName.SigmaX:
                return(new SigmaXGate(targetRef));

            case GateName.SigmaY:
                return(new SigmaYGate(targetRef, controlRef));

            case GateName.SigmaZ:
                return(new SigmaZGate(targetRef, controlRef));

            case GateName.SqrtX:
                return(new SqrtXGate(targetRef, controlRef));

            case GateName.Toffoli:
                ToffoliGate        t         = gate as ToffoliGate;
                RegisterRefModel[] tcontrols = t.Controls.Select <RegisterRefModel, RegisterRefModel>(x =>
                                                                                                      GetRefFromOffset(x.OffsetToRoot + referenceBeginRow)).ToArray <RegisterRefModel>();
                return(new ToffoliGate(targetRef, tcontrols));

            case GateName.Unitary:
                UnitaryGate u = gate as UnitaryGate;
                return(new UnitaryGate(u.Matrix, targetRef, controlRef));

            default:
                return(null);
            }
        }
Esempio n. 19
0
 public EmptyGate(RegisterRefModel row)
 {
     _row = row;
 }
Esempio n. 20
0
 public InvCPhaseShiftGate(int dist, RegisterRefModel target, params RegisterRefModel[] controls)
     : base(target, controls)
 {
     _dist = dist;
 }
Esempio n. 21
0
 public PhaseKickGate(double gamma, RegisterRefModel target, params RegisterRefModel[] controls)
     : base(target, controls)
 {
     _gamma = gamma;
 }
Esempio n. 22
0
        public UnitaryGate(Complex[,] matrix, RegisterRefModel target, RegisterRefModel?control = null)

            : base(target, control)
        {
            _matrix = matrix;
        }
Esempio n. 23
0
 public HadamardGate(RegisterRefModel target, RegisterRefModel?control = null)
     : base(target, control)
 {
 }
Esempio n. 24
0
 public AngleGate(double gamma, RegisterRefModel target, RegisterRefModel?control = null)
     : base(target, control)
 {
     _gamma = gamma;
 }
Esempio n. 25
0
 public SigmaYGate(RegisterRefModel target, RegisterRefModel?control = null)
     : base(target, control)
 {
 }
Esempio n. 26
0
 public ToffoliGate(RegisterRefModel target, RegisterRefModel control, params RegisterRefModel[] restControls)
     : base(target, control, restControls)
 {
 }
Esempio n. 27
0
 public RotateZGate(double gamma, RegisterRefModel target, RegisterRefModel?control = null)
     : base(gamma, target, control)
 {
 }
Esempio n. 28
0
 public ToffoliGate(RegisterRefModel target, params RegisterRefModel[] controls)
     : base(target, controls)
 {
 }
Esempio n. 29
0
 public CNotGate(RegisterRefModel target, RegisterRefModel control)
 {
     _control = control;
     _target  = target;
 }
Esempio n. 30
0
 public MultiControlledGate(RegisterRefModel target, params RegisterRefModel[] controls)
 {
     _controls = controls;
     _target   = target;
 }