Circuit Class

Liquid Quantum Simulator

Circuit Class
The circuit representation of an operation in a quantum algorithm. Circuits are generally created using Circuit.Compile.
Inheritance Hierarchy
SystemObject  Microsoft.Research.LiquidCircuit

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.5981.24943 (1.0.*)
Syntax
F#
[<SerializableAttribute>]
type Circuit =  class end

The Circuit type exposes the following members.

Properties
  NameDescription
Public propertyNotEmpty
Is this Circuit element not the "Empty" circuit.
Top
Methods
  NameDescription
Public methodStatic memberCompile
Compiles a function implemented as a sequence of gate function calls into a Circuit.
Public methodDump
Dumps this circuit recursively to the console and/or log.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFindIds
Find Ids below this point and the time needed to execute the circuit (internal)
Public methodFold
Rewrites this circuit by identifying opportunities for parallelism and turning Seq elements into Par elements where possible. This makes for a better rendering.
Public methodGateCount
Gets the count of gates in circuit. Note that pure label gates -- that is, gates of type String -- are never counted.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGrow
Creates an optimized "grown" version of this Circuit. The type and limits of the conversion are specified in the grow parameter.
Public methodGrowGates
Creates an equivalent circuit to this circuit by aggregating existing unitary gates into larger unitary gates. The new circuit will execute faster because it has fewer matrix applications required.
Public methodGrowSingle
Converts this circuit into a single unitary gate, implemented by a single matrix. This allows maximum optimization of circuit execution.

This circuit must be completely unitary to be converted into a single matrix. If it is not, an exception will be raised by this method.

Public methodRemoveRedund
Creates a new circuit logically equivalent to this circuit, but with redundant gates removed. For instance, if this routine found a sequence of two X gates in succession on the same qubit, it would remove both of them from the result.
Public methodRender
Renders this circuit to a file.
Public methodRenderHT
Renders a circuit to both svg, for HTML, and tikz, for TeX.
Public methodReverse
Reverses this circuit, which must contain only unitary gates. In addition, bottom-level gates are replaced by their adjoints. This method will raise an exception if this circuit contains a non-unitary gate.
Public methodRun
Runs this Circuit. The state of the Ket containing the passed-in qubits will be modified.
Public methodToString
Returns a string representing the current circuit element.
(Overrides ObjectToString.)
Public methodWires
Gets the list of wires (qubit IDs) touched by this circuit.
Top
Remarks
The possible types of circuits are:
  • Seq: A list of sub-circuits executed equentially.
  • Par: A list of sub-circuits executed in parallel.
  • Apply: Application of a single gate.
  • Ext: Application of a single gate that extends a parent, such as an adjoint or control. This type of circuit is created from a Modify gate.
  • BitCon: Application of a classically-controlled (BCOp) gate.
  • Wrap: A sub-circuit wrapped into a single gate for more concise rendering.
  • Empty: A circuit that does nothing.
See Also