This class represents the Toffoli operation. This is also known as the double controlled
not or controlled-controlled not. If the two control qubits are |1> then the single
target qubit is flipped. If not, then nothing happens.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public class OperationToffoli : GeneralSimulatedOperation, IOperationToffoli, IQuantumOperation, ICoveObject
Public Class OperationToffoli _ Inherits GeneralSimulatedOperation _ Implements IOperationToffoli, IQuantumOperation, ICoveObject
public ref class OperationToffoli : public GeneralSimulatedOperation, IOperationToffoli, IQuantumOperation, ICoveObject
Members
All Members | Constructors | Methods | Fields | ||
Icon | Member | Description |
---|---|---|
OperationToffoli()()() |
The default constructor.
| |
OperationToffoli(Int32, Int32, Int32) | ||
Clone()()() |
Return a clone (deep copy) of the current operation. This operation returned can be modified
without any impact to this object. Unlike quantum registers, quantum operations cannot be
in superposition- hence a clone of them does not violate the no-cloning theorem.
| |
Combine(IQuantumOperation) |
Combine two same sized operations into one.
(Inherited from GeneralSimulatedOperation.) | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize()()() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
FIRST_CONTROL_INDEX |
The index in listTargetQubits that is the first control qubit.
| |
GetFirstControlIndex()()() |
Get the index of the first control qubit in the register when this operation is applied.
| |
GetHashCode()()() | Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) | |
GetOperationAndTargets()()() |
Get a string that shows the operations name and target. An example might
be something like "CNOT: Control = 0, Target = 2".
(Overrides GeneralSimulatedOperation.GetOperationAndTargets()()().) | |
GetOperationComplexMatrix()()() |
Return the object that represents the operation. The result is a deep copy
of the operation matrix.
(Inherited from GeneralSimulatedOperation.) | |
GetOperationMatrix()()() |
Get the matrix object that represents this operation. The ComplexMatrix
returned is a deep copy, so changes the object returned do not effect this object.
(Inherited from GeneralSimulatedOperation.) | |
GetSecondControlIndex()()() |
Get the index of the second control qubit in the register when this operation is applied.
| |
GetTargetIndex()()() |
Get the index of the target qubit when this operation is applied.
| |
GetType()()() | Gets the Type of the current instance. (Inherited from Object.) | |
IsValidOperation()()() |
Checks to see if the operation is a valid quantum operation, that it is unitary.
(Inherited from GeneralSimulatedOperation.) | |
listTargetQubits |
Represents the targets for the various qubits the operation
operates on. Index represents the standard target, value
represents the actual target. Example: In a standard CNot
the first (index 0) qubit is the control and the second (index 1)
is the target. The list will be 2 elements with element 0 representing
the control and element 1 representing the target. If the list is
then {3, 0} this means that the control targets index 3 of the target
register and the target of the operation is index 0 of the target
register.
(Inherited from GeneralSimulatedOperation.) | |
MemberwiseClone()()() | Creates a shallow copy of the current Object. (Inherited from Object.) | |
NumberOfQubitsOperatesOn()()() |
Return the number of qubits that this operation operates on. The number
of qubits it operates on is the highest target qubit. Example: If a Toffolli
operation targets qubit indexes 4, 2, 6 in a register then this will return
7 (index 6 is the 7th qubit).
(Inherited from GeneralSimulatedOperation.) | |
OperationMatrix | The matrix representing the operation. (Inherited from GeneralSimulatedOperation.) | |
SECOND_CONTROL_INDEX |
The index in listTargetQubits that is the second control qubit.
| |
SetFirstControlIndex(Int32) |
Set the first control index.
| |
SetIndexes(Int32, Int32, Int32) |
Set the indexes of qubits in a register when this operation is applied.
| |
SetSecondControlIndex(Int32) |
Set the second control index.
| |
SetTargetlIndex(Int32) |
Set the target index.
| |
TARGET_INDEX |
The index in listTargetQubits that is the target qubit.
| |
Tensor(IQuantumOperation) |
Tensor two operations into one combined one.
(Inherited from GeneralSimulatedOperation.) | |
ToString()()() |
Get the string representation of this operation.
(Inherited from GeneralSimulatedOperation.) |
Inheritance Hierarchy
Object | ||
GeneralSimulatedOperation | ||
OperationToffoli |