Click or drag to resize
Ket Methods

The Ket type exposes the following members.

Methods
  NameDescription
Public methodAdd(Bit)
Adds a new qubit to the state with a classical Bit value. The new qubit is unentangled and has the provided state. Note that the new qubit is not considered measured.
Public methodAdd(CVec)
Adds a new qubit to the state with a complex state vector. The new qubit is unentangled and has the provided state.
Public methodAdd(Int32, Bit)
Adds multiple qubits to the state, all with the same classical Bit value. The new qubits are unentangled and have the provided state. Note that the new qubits are not considered measured.
Public methodCopy
Makes a new Ket that is a deep copy of this Ket.
Public methodDecohere
Applies a function to each Qubit in the state vector, returning the list of qubit IDs for which the function returned true. This method is usually used to apply noise to the state.
Public methodDump
Dump this state vector.
Public methodDumpKP
Dump the portion of this state vector that includes a specific qubit and all of the qubits it is entangled with. If this Ket is a product state, then only the factor containing the specified qubit is dumped.
Public methodEntropy
Get the entanglement entropy
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodJoin
Joins another Ket to the end of this one (added Ket is NOT usable after this)
Public methodNormDiff
Get L2 Norm of the difference of two ket vectors
Public methodProb1
Get the probability of measuring 1 for a single qubit
Public methodProbOdd
Get the probability of measuring odd parity for a set of qubits
Public methodProbs
Get the state probabilities for a list of qubits (l.e. 10 qubits)
Public methodPurity
Finds the purity of each qubit in this Ket. NOT OPTIMIZED.
Public methodStatic memberRead(BinaryReader)
Reads a new state vector from a binary stream. Note that this routine is only intended to read vectors written with the Write method.
Public methodStatic memberRead(String)
Reads a new state vector from a file. Note that this routine is only intended to read vectors written with the Write method.
Public methodReset
Resets this Ket to an initial state with a specified number of qubits.
Public methodSingle
Treats this Ket as if all of its qubits are entangled.
Public methodToString
Gets a string representation of this Ket. This string may be extremely long; in general, it will have 2^N lines if there are N qubits in the Ket. Generally it is better to use the Dump method instead.
(Overrides ObjectToString.)
Public methodWrite(BinaryWriter)
Writes this state vector to a binary stream.
Public methodWrite(String)
Writes this state vector to a file.
Top
See Also