Microsoft.Research.Liquid Namespace

The Language-Integrated Quantum Operations (LIQUi|>) Simulator
Microsoft.Research.Liquid Namespace
Classes
 | Class | Description
Public class | App | Utilities for executing the Liquid application.
Public class | Bit | Represents the measured value, in the computational basis, of a qubit.
Public class | Circuit | The circuit representation of an operation in a quantum algorithm. Circuits are generally created using Circuit.Compile.
Public class | CMat | A dense matrix of complex numbers.
Public class | CSMat | A sparse matrix of complex numbers.
Public class | CVec | A block-sparse vector of complex numbers.
Public class | Fermion | Hamiltonian simulation for fermionic systems.
Public class | Gate | A quantum gate.
Public class | GateOp | Gate operation type. This is used in Gate definitions.
Public class | GrowPars | Parameters that control circuit growth. See Circuit.Grow, Circuit.GrowGates, and Circuit.GrowSingle.
Public class | Hamiltonian | Base class for Hamiltonian dynamics simulators.
Public class | HamiltonianGates | A collection of gates that are useful for Hamiltonian simulation and annealing.
Public class | Ket | Represents a state vector.
Public class | Noise | A complete noise model for a specific circuit.
Public class | NoiseEvents | Noise statistics that are tracked for normal and error-correcting gates.
Public class | NoiseModel | A noise model for a particular type of gate (or set of gates).
Public class | NoiseStat | Statistics tracked for each time that noise is applied.
Public class | NoisyMats | Utility class for computing a Pauli rotation matrix. This is used to run quantum chemistry circuits with noise injected.
Public class | Operations | The Operations module provides definitions of basic gates. It also includes some handy operators for manipulating qubit lists, and some operations for building gates from existing gates.
Public class | QECC | Base class for quantum error correcting codes.
Public class | Qubit | Represents a quantum bit. New Qubits are created using the Ket Add methods.
Public class | RunMode | Trotterization types.
Public class | Spin | Hamiltonian for spin systems, such as the Ising model or a spin glass.
Public class | SpinTerm | A single term in a Spin Hamiltonian.
Public class | Stabilizer | A stabilizer-based simulator based on CHP by Scott Aaronson and Daniel Gottesman. See arXiv:quant-ph/0406196 for more details.
Public class | Steane7 | Implementation of a Steane 7-bit quantum error correcting code, [[7,1,3]], based on the QECC class.
Public class | Tests | A collection of sample Liquid simulations and tests, plus some utility routines to make it easier to write new samples.
Public class | Util | General utilities used by the rest of the system
Public class | UtilLQDAttribute | Allows a function to be visable from a LIQUiD script or the command line
Public class | UtilprocStatsT | Current process memory usage statistics. Returned by the procStates function.
Structures
 | Structure | Description
Public structure | Complex | Data type for complex numbers.

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


App Class

App Class
Utilities for executing the Liquid application.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidApp

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SealedAttribute>]
type App =  class end

The App type exposes the following members.

Methods
Name | Description
RunLiquid | The main routine for running Liquid. This function gets the command-line parameters from the environment, parses them, and executes the requested Liquid method.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace


App Methods

App Methods

The App type exposes the following members.

Methods
Name | Description
RunLiquid | The main routine for running Liquid. This function gets the command-line parameters from the environment, parses them, and executes the requested Liquid method.
Top
See Also

Reference

App Class


App.RunLiquid Method

AppRunLiquid Method
The main routine for running Liquid. This function gets the command-line parameters from the environment, parses them, and executes the requested Liquid method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member RunLiquid : unit -> int

Return Value

Type: Int32
0 if execution succeeded, or 1 if an error occured.
See Also

Reference

App Class


Bit Class

Bit Class
Represents the measured value, in the computational basis, of a qubit.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidBit

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type Bit =
    class
        interface IEquatable<Bit>
        interface IStructuralEquatable
        interface IComparable<Bit>
        interface IComparable
        interface IStructuralComparable
    end

The Bit type exposes the following members.

Properties
 | Name | Description
Public property | v | The integer value of a measured qubit, either 0 or 1. Note that this property will throw an exception if the value is unknown.
Top
Methods
 | Name | Description
Public method | Dump | Dumps the measured value.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of this value. The string will be "Zero", "One", or "?". (Overrides ObjectToString.)
Top
Remarks
Possible values are:
  • Unknown: The qubit has not been measured since it was initialized or since the last time it was reanimated.
  • Zero: The qubit was last measured as |0> in the computational basis and has not been reanimated since.
  • One: The qubit was last measured as |1> in the computational basis and has not been reanimated since.
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Bit Properties

Bit Properties

The Bit type exposes the following members.

Properties
 | Name | Description
Public property | v | The integer value of a measured qubit, either 0 or 1. Note that this property will throw an exception if the value is unknown.
Top
See Also

Reference

Bit Class


Bit.v Property

Bitv Property
The integer value of a measured qubit, either 0 or 1. Note that this property will throw an exception if the value is unknown.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member v : int with get

Property Value

Type: Int32
See Also

Reference

Bit Class


Bit Methods

Bit Methods

The Bit type exposes the following members.

Methods
 | Name | Description
Public method | Dump | Dumps the measured value.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of this value. The string will be "Zero", "One", or "?". (Overrides ObjectToString.)
Top
See Also

Reference

Bit Class


Bit.Dump Method

BitDump Method
Dumps the measured value.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Bit Class


Bit.ToString Method

BitToString Method
Gets a string representation of this value. The string will be "Zero", "One", or "?".

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string
See Also

Reference

Bit Class


Circuit Class

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.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Circuit =  class end

The Circuit type exposes the following members.

Properties
 | Name | Description
Public property | NotEmpty | Is this Circuit element not the "Empty" circuit.
Top
Methods
 | Name | Description
 | Compile | Compiles a function implemented as a sequence of gate function calls into a Circuit.
Public method | Dump | Dumps this circuit recursively to the console and/or log.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FindIds | Find Ids below this point and the time needed to execute the circuit (internal)
Public method | Fold | Rewrites this circuit by identifying opportunities for parallelism and turning Seq elements into Par elements where possible. This makes for a better rendering.
Public method | GateCount | Gets the count of gates in circuit. Note that pure label gates -- that is, gates of type String -- are never counted.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Grow | Creates an optimized "grown" version of this Circuit. The type and limits of the conversion are specified in the grow parameter.
Public method | GrowGates | 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 method | GrowSingle | 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 method | RemoveRedund | 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 method | Render | Renders this circuit to a file.
Public method | RenderHT | Renders a circuit to both svg, for HTML, and tikz, for TeX.
Public method | Reverse | 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 method | Run | Runs this Circuit. The state of the Ket containing the passed-in qubits will be modified.
Public method | ToString | Returns a string representing the current circuit element. (Overrides ObjectToString.)
Public method | Wires | 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

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Circuit Properties

Circuit Properties

The Circuit type exposes the following members.

Properties
 | Name | Description
Public property | NotEmpty | Is this Circuit element not the "Empty" circuit.
Top
See Also

Reference

Circuit Class


Circuit.NotEmpty Property

CircuitNotEmpty Property
Is this Circuit element not the "Empty" circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member NotEmpty : bool with get

Property Value

Type: Boolean
See Also

Reference

Circuit Class


Circuit Methods

Circuit Methods

The Circuit type exposes the following members.

Methods
 | Name | Description
 | Compile | Compiles a function implemented as a sequence of gate function calls into a Circuit.
Public method | Dump | Dumps this circuit recursively to the console and/or log.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FindIds | Find Ids below this point and the time needed to execute the circuit (internal)
Public method | Fold | Rewrites this circuit by identifying opportunities for parallelism and turning Seq elements into Par elements where possible. This makes for a better rendering.
Public method | GateCount | Gets the count of gates in circuit. Note that pure label gates -- that is, gates of type String -- are never counted.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Grow | Creates an optimized "grown" version of this Circuit. The type and limits of the conversion are specified in the grow parameter.
Public method | GrowGates | 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 method | GrowSingle | 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 method | RemoveRedund | 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 method | Render | Renders this circuit to a file.
Public method | RenderHT | Renders a circuit to both svg, for HTML, and tikz, for TeX.
Public method | Reverse | 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 method | Run | Runs this Circuit. The state of the Ket containing the passed-in qubits will be modified.
Public method | ToString | Returns a string representing the current circuit element. (Overrides ObjectToString.)
Public method | Wires | Gets the list of wires (qubit IDs) touched by this circuit.
Top
See Also

Reference

Circuit Class


Circuit.Compile Method

CircuitCompile Method
Compiles a function implemented as a sequence of gate function calls into a Circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Compile :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> Circuit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate function to compile.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The qubits the new Circuit will operate on.

Return Value

Type: Circuit
A new Circuit that represents the function calls
See Also

Reference

Circuit Class


Circuit.Dump Method

CircuitDump Method
Dumps this circuit recursively to the console and/or log.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Circuit Class


Circuit.FindIds Method

CircuitFindIds Method
Find Ids below this point and the time needed to execute the circuit (internal)

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member FindIds :
        detail : int *
        cntEmpty : FSharpOption<bool> -> Tuple<FSharpSet<int>, int>

Parameters

detail
Type: SystemInt32
What level of detail for when we hit a "Wrap" gate
cntEmpty
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option allowing Empty gates to be counted like Native The default is false, which is to not count Empty gates as Native.

Return Value

Type: Tuple FSharpSetInt32 , Int32
Set of ids,total time to execute
See Also

Reference

Circuit Class


Circuit.Fold Method

CircuitFold Method
Rewrites this circuit by identifying opportunities for parallelism and turning Seq elements into Par elements where possible. This makes for a better rendering.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Fold :
        agressive : FSharpOption<bool> -> Circuit

Parameters

agressive
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to fold as much as possible by decomposing this circuit into basic gates before folding. The default is to not decompose Wrap gates and other aggregates before folding.

Return Value

Type: Circuit
The new folded circuit
See Also

Reference

Circuit Class


Circuit.GateCount Method

CircuitGateCount Method
Gets the count of gates in circuit. Note that pure label gates -- that is, gates of type String -- are never counted.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member GateCount :
        doParallel : FSharpOption<bool> *
        gMatch : FSharpOption<FSharpFunc<Gate, bool>> -> int

Parameters

doParallel
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to only count the longest sub-circuit of a parallel component, rather than adding all gates in all components. This is useful when computing gate depth. The default is false, which counts all gates, summing over parallel sub-circuits.
gMatch
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncGate, Boolean
An optional function to filter which gates should be counted. If a match function is provided, only gates that return true are included in the count. The default is to count all non-String gates.

Return Value

Type: Int32
The count of low-level gates in the circuit
See Also

Reference

Circuit Class


Circuit.Grow Method

CircuitGrow Method
Creates an optimized "grown" version of this Circuit. The type and limits of the conversion are specified in the grow parameter.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Grow :
        k : Ket *
        gp : GrowPars -> Circuit

Parameters

k
Type: Microsoft.Research.LiquidKet
A Ket this Circuit could be run with.
gp
Type: Microsoft.Research.LiquidGrowPars
The grow parameters to use. See the GrowPars type for details.

Return Value

Type: Circuit
A new, optimized Circuit
See Also

Reference

Circuit Class


Circuit.GrowGates Method

CircuitGrowGates Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member GrowGates :
        k : Ket *
        gp : FSharpOption<GrowPars> -> Circuit

Parameters

k
Type: Microsoft.Research.LiquidKet
A Ket this Circuit could be run with.
gp
Type: Microsoft.FSharp.CoreFSharpOptionGrowPars
Optional grow parameters. The default is to use all of the GrowPars defaults. See the GrowPars type for details.

Return Value

Type: Circuit
New optimized Circuit
See Also

Reference

Circuit Class


Circuit.GrowSingle Method

CircuitGrowSingle Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member GrowSingle :
        gp : GrowPars -> Circuit

Parameters

gp
Type: Microsoft.Research.LiquidGrowPars
Optional grow parameters. The default is to use all of the GrowPars defaults. See the GrowPars type for details.

Return Value

Type: Circuit
The new single-gate Circuit
See Also

Reference

Circuit Class


Circuit.RemoveRedund Method

CircuitRemoveRedund Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member RemoveRedund : unit -> Circuit

Return Value

Type: Circuit
The new, trimmed circuit
See Also

Reference

Circuit Class


Circuit.Render Method

CircuitRender Method
Renders this circuit to a file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Render :
        file : string *
        typ : FSharpOption<string> *
        detail : FSharpOption<int> *
        split : FSharpOption<float> *
        scale : FSharpOption<float> -> unit

Parameters

file
Type: SystemString
The full name of the file to create, including the extension.
typ
Type: Microsoft.FSharp.CoreFSharpOptionString
The optional format for the rendered graphics. Possible values are:
  • "qc": QCircuit Liquid format
  • "tikz": TikZ Liquid format for TeX and LaTeX
  • "svg": Vector graphics format for HTML
The default is "svg".
detail
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An option specifying how many levels of Wrap to unwrap. The default is 999.
split
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An option specifying what percentage of the total gates should go into each figure, if the circuit won't fit into a single figure. The default value varies with the figure size.
scale
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An option specifying a scaling percentage for the rendering, with 100.0 being full size. The default value varies with the figure size.
Remarks
Detail is 0 for least, increasing wrap levels by each increment. That is, at level 0 only the top-level gate of a Wrap is displayed; at level 1, the top-level circuit that implements the Wrap is displayed; at l;evel 2, the top-level circuit is displayed with its Wrap gates also unwrapped once; etc.
See Also

Reference

Circuit Class


Circuit.RenderHT Method

CircuitRenderHT Method
Renders a circuit to both svg, for HTML, and tikz, for TeX.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member RenderHT :
        file : string *
        detail : FSharpOption<int> *
        split : FSharpOption<float> *
        scale : FSharpOption<float> -> unit

Parameters

file
Type: SystemString
The base name of the files to create. Appropriate extensions will be added for the created files: ".htm" for the SVG rendering, and ".tex" for the TikZ rendering.
detail
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An option specifying how many levels of Wrap to unwrap. The default is 999.
split
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An option specifying what percentage of the total gates should go into each figure, if the circuit won't fit into a single figure. The default value varies with the figure size.
scale
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An option specifying a scaling percentage for the rendering, with 100.0 being full size. The default value varies with the figure size.
Remarks
Detail is 0 for least, increasing wrap levels by each increment. That is, at level 0 only the top-level gate of a Wrap is displayed; at level 1, the top-level circuit that implements the Wrap is displayed; at l;evel 2, the top-level circuit is displayed with its Wrap gates also unwrapped once; etc.
See Also

Reference

Circuit Class
Microsoft.Research.Liquid Namespace
CircuitRender(String, FSharpOptionString, FSharpOptionInt32, FSharpOptionDouble, FSharpOptionDouble)


Circuit.Reverse Method

CircuitReverse Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Reverse : unit -> Circuit

Return Value

Type: Circuit
The resulting reversed circuit
See Also

Reference

Circuit Class


Circuit.Run Method

CircuitRun Method
Runs this Circuit. The state of the Ket containing the passed-in qubits will be modified.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of Qubits to operate on. These must correspond to the qubits the circuit was compiled with; that is, they must have the same qubit IDs as those.
See Also

Reference

Circuit Class


Circuit.ToString Method

CircuitToString Method
Returns a string representing the current circuit element.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

Circuit Class


Circuit.Wires Method

CircuitWires Method
Gets the list of wires (qubit IDs) touched by this circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Wires : unit -> FSharpList<int>

Return Value

Type: FSharpListInt32
A list of the wires used
See Also

Reference

Circuit Class


CMat Class

CMat Class
A dense matrix of complex numbers.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidCMat

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type CMat =  class end

The CMat type exposes the following members.

Constructors
 | Name | Description
Public method | CMat(Double, Double) | Creates a new matrix from arrays of real and imaginary parts.
Public method | CMat(Int32, FSharpListTupleInt32, Int32, Double, Double) | Creates a square matrx from a sparse list of elements.
Public method | CMat(Int32, FSharpOptionBoolean) | Creates a square identity or zero matrix.
Top
Properties
 | Name | Description
Public property | Item | Gets an individual element of the matrix, as a Complex number.
Public property | Length | The number of rows or columns in the matrix, for square matrices.
Public property | LengthC | The number of columns in the matrix.
Public property | LengthR | The number of rows in the matrix.
Top
Methods
 | Name | Description
Public method | Add | Adds another matrix to this matrix. The two matrices must have the same number of rows and columns.
Public method | Adj | Computes the adjoint (complex conjugate transpose) of this matrix.
Public method | Clear | Clears this matrix, setting it to a 0x0 matrix.
Public method | Copy | Makes a new copy, independent copy of this matrix.
 | CreMat | Creates an array that can be filled in and passed to the array-based CMat constructor.
 | CreZer | Creates an array filled with zeros that can be filled in and passed to the array-based CMat constructor.
Public method | Div | Scales this matrix by a constant divisor. This matrix is updated in place, rather than a new matrix being created.
Public method | Dump | Dumps this matrix. Note that there is no limit on the size of the result; every row and column entry is included.
Public method | DumpML | Dumps this matrix in Matlab format for debugging.
Public method | DumpNarrow | Dumps this matrix. This method will produce a relatively compact representation of the matrix.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FixUnitary | Makes this matrix closer to being unitary by applying an iterative correction.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kron(CMat) | Computes the Kronecker Product of this matrix with another matrix.
Public method | Kron(Int32, FSharpOptionBoolean) | Computes the Kronecker Product of this matrix with an identity matrix
Public method | Mul(Double) | Scales this matrix by a constant multiplier. This matrix is updated in place, rather than a new matrix being created.
Public method | Mul(CMat) | Computes the product of this matrix with another matrix. This matrix is on the left-hand side of the product, and the argument matrix is on the right-hand side. This matrix must have the same number of columns as the other matrix has rows.
Public method | Mul(CVec) | Calculates the product of this matrix and a vector. The vector's length must match the numder of columns in this matrix.
Public method | Power | Computes an integer power of this matrix. NOTE: This destroys the contents of the current matrix.
 | Read | Reads a matrix from a stream.
Public method | ToString | Gets a string representation of this matrix. Note that there is no limit on the size of the result; every row and column entry is included. (Overrides ObjectToString.)
Public method | UnitaryError | Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.
Public method | Write | Writes this matrix to a stream for serialization.
Top
Operators
Name | Description
AdditionAssignment | Adds one matrix to another.
DivisionAssignment | Scales a matrix by a constant divisor. The matrix is updated in place, rather than a new matrix being created.
Multiply(CMat, CMat) | Computes the product of two matrices. The first matrix must have the same number of columns as the second matrix has rows.
Multiply(CMat, CVec) | Computes the product of a matrix and a vector. The vector's length must match the numder of columns in the matrix.
MultiplyAssignment | Scales a matrix by a constant multiplier. The matrix is updated in place, rather than a new matrix being created.
MultiplyBang | Computes the Kronecker product of two matrices
Top
See Also

Reference

Microsoft.Research.Liquid Namespace
[T::Microsoft.Research.Liquid.CSMat]


CMat Constructor

CMat Constructor
Overload List
 | Name | Description
Public method | CMat(Double, Double) | Creates a new matrix from arrays of real and imaginary parts.
Public method | CMat(Int32, FSharpListTupleInt32, Int32, Double, Double) | Creates a square matrx from a sparse list of elements.
Public method | CMat(Int32, FSharpOptionBoolean) | Creates a square identity or zero matrix.
Top
See Also

Reference

CMat Class


CMat Constructor (Double[][], Double[][])

CMat Constructor (Double, Double)
Creates a new matrix from arrays of real and imaginary parts.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        rs : float[][] *
        is : float[][] -> CMat

Parameters

rs
Type: SystemDouble
The real part of each matrix element.
is
Type: SystemDouble
The real part of each matrix element.
See Also

Reference

CMat Class
CMat Overload


CMat Constructor (Int32, FSharpList(Tuple(Int32, Int32, Double, Double)))

CMat Constructor (Int32, FSharpListTupleInt32, Int32, Double, Double)
Creates a square matrx from a sparse list of elements.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        len : int *
        xyris : FSharpList<Tuple<int, int, float, float>> -> CMat

Parameters

len
Type: SystemInt32
The row (or column) length of the matrix.
xyris
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32, Double, Double
A list of element location and value tuples, with elements in the order (row,col,real,imag).
See Also

Reference

CMat Class
CMat Overload


CMat Constructor (Int32, FSharpOption(Boolean))

CMat Constructor (Int32, FSharpOptionBoolean)
Creates a square identity or zero matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        n : int *
        zero : FSharpOption<bool> -> CMat

Parameters

n
Type: SystemInt32
The row (or column) length of the matrix.
zero
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
Option to initialize to a zero matrix rather than to the identity matrix. The default is to initialize to the identity.
See Also

Reference

CMat Class
CMat Overload


CMat Properties

CMat Properties

The CMat type exposes the following members.

Properties
 | Name | Description
Public property | Item | Gets an individual element of the matrix, as a Complex number.
Public property | Length | The number of rows or columns in the matrix, for square matrices.
Public property | LengthC | The number of columns in the matrix.
Public property | LengthR | The number of rows in the matrix.
Top
See Also

Reference

CMat Class


CMat.Item Property

CMatItem Property
Gets an individual element of the matrix, as a Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Item : Complex with get, set

Parameters

i
Type: SystemInt32
The row index.
j
Type: SystemInt32
The column index.

Return Value

Type: Complex
The complex value of the matrix element.
See Also

Reference

CMat Class


CMat.Length Property

CMatLength Property
The number of rows or columns in the matrix, for square matrices.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Length : int with get

Property Value

Type: Int32
See Also

Reference

CMat Class


CMat.LengthC Property

CMatLengthC Property
The number of columns in the matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member LengthC : int with get

Property Value

Type: Int32
See Also

Reference

CMat Class


CMat.LengthR Property

CMatLengthR Property
The number of rows in the matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member LengthR : int with get

Property Value

Type: Int32
See Also

Reference

CMat Class


CMat Methods

CMat Methods

The CMat type exposes the following members.

Methods
 | Name | Description
Public method | Add | Adds another matrix to this matrix. The two matrices must have the same number of rows and columns.
Public method | Adj | Computes the adjoint (complex conjugate transpose) of this matrix.
Public method | Clear | Clears this matrix, setting it to a 0x0 matrix.
Public method | Copy | Makes a new copy, independent copy of this matrix.
 | CreMat | Creates an array that can be filled in and passed to the array-based CMat constructor.
 | CreZer | Creates an array filled with zeros that can be filled in and passed to the array-based CMat constructor.
Public method | Div | Scales this matrix by a constant divisor. This matrix is updated in place, rather than a new matrix being created.
Public method | Dump | Dumps this matrix. Note that there is no limit on the size of the result; every row and column entry is included.
Public method | DumpML | Dumps this matrix in Matlab format for debugging.
Public method | DumpNarrow | Dumps this matrix. This method will produce a relatively compact representation of the matrix.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FixUnitary | Makes this matrix closer to being unitary by applying an iterative correction.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kron(CMat) | Computes the Kronecker Product of this matrix with another matrix.
Public method | Kron(Int32, FSharpOptionBoolean) | Computes the Kronecker Product of this matrix with an identity matrix
Public method | Mul(Double) | Scales this matrix by a constant multiplier. This matrix is updated in place, rather than a new matrix being created.
Public method | Mul(CMat) | Computes the product of this matrix with another matrix. This matrix is on the left-hand side of the product, and the argument matrix is on the right-hand side. This matrix must have the same number of columns as the other matrix has rows.
Public method | Mul(CVec) | Calculates the product of this matrix and a vector. The vector's length must match the numder of columns in this matrix.
Public method | Power | Computes an integer power of this matrix. NOTE: This destroys the contents of the current matrix.
 | Read | Reads a matrix from a stream.
Public method | ToString | Gets a string representation of this matrix. Note that there is no limit on the size of the result; every row and column entry is included. (Overrides ObjectToString.)
Public method | UnitaryError | Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.
Public method | Write | Writes this matrix to a stream for serialization.
Top
See Also

Reference

CMat Class


CMat.Add Method

CMatAdd Method
Adds another matrix to this matrix. The two matrices must have the same number of rows and columns.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Add :
        m2 : CMat -> unit

Parameters

m2
Type: Microsoft.Research.LiquidCMat
The matrix to add to this one.
See Also

Reference

CMat Class


CMat.Adj Method

CMatAdj Method
Computes the adjoint (complex conjugate transpose) of this matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Adj : unit -> CMat

Return Value

Type: CMat
The adjoint matrix
See Also

Reference

CMat Class


CMat.Clear Method

CMatClear Method
Clears this matrix, setting it to a 0x0 matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Clear : unit -> unit
See Also

Reference

CMat Class


CMat.Copy Method

CMatCopy Method
Makes a new copy, independent copy of this matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> CMat

Return Value

Type: CMat
The new matrix
See Also

Reference

CMat Class


CMat.CreMat Method

CMatCreMat Method
Creates an array that can be filled in and passed to the array-based CMat constructor.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CreMat :
        lenR : int *
        lenC : int *
        f : FSharpFunc<int, FSharpFunc<int, float>> -> float[][]

Parameters

lenR
Type: SystemInt32
The number of rows
lenC
Type: SystemInt32
The number of columns
f
Type: Microsoft.FSharp.CoreFSharpFuncInt32, FSharpFuncInt32, Double
The function to call to compute the elements of the array. It will get called with the row first and then the column (curried).

Return Value

Type: Double
The new array
See Also

Reference

CMat Class


CMat.CreZer Method

CMatCreZer Method
Creates an array filled with zeros that can be filled in and passed to the array-based CMat constructor.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CreZer :
        lenR : int *
        lenC : int -> float[][]

Parameters

lenR
Type: SystemInt32
The number of rows
lenC
Type: SystemInt32
The number of columns

Return Value

Type: Double
The new array
See Also

Reference

CMat Class


CMat.Div Method

CMatDiv Method
Scales this matrix by a constant divisor. This matrix is updated in place, rather than a new matrix being created.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Div :
        div : float -> CMat

Parameters

div
Type: SystemDouble
The scale divisor. The matrix is multiplied by 1/div.

Return Value

Type: CMat
This matrix, as updated after scaling
See Also

Reference

CMat Class


CMat.Dump Method

CMatDump Method
Dumps this matrix. Note that there is no limit on the size of the result; every row and column entry is included.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

CMat Class


CMat.DumpML Method

CMatDumpML Method
Dumps this matrix in Matlab format for debugging.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpML :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        prec : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
prec
Type: Microsoft.FSharp.CoreFSharpOptionInt32
precision 0=low 1=normal 2=high 3=full (optional=1)
See Also

Reference

CMat Class


CMat.DumpNarrow Method

CMatDumpNarrow Method
Dumps this matrix. This method will produce a relatively compact representation of the matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpNarrow :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

CMat Class


CMat.FixUnitary Method

CMatFixUnitary Method
Makes this matrix closer to being unitary by applying an iterative correction.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member FixUnitary :
        tol : FSharpOption<float> *
        maxIter : FSharpOption<int> -> Tuple<int, float>

Parameters

tol
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional desired tolerance for the deviation from unitarity, as measured by UnitaryError. The default is 1.0e-13.
maxIter
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional maximum number of iterations to perform. The default is 5.

Return Value

Type: Tuple Int32, Double
A tuple of the number of iterations performed, for cost estimates, and the final deviation from unitarity.
See Also

Reference

CMat Class


CMat.Kron Method

CMatKron Method
Overload List
 | Name | Description
Public method | Kron(CMat) | Computes the Kronecker Product of this matrix with another matrix.
Public method | Kron(Int32, FSharpOptionBoolean) | Computes the Kronecker Product of this matrix with an identity matrix
Top
See Also

Reference

CMat Class


CMat.Kron Method (CMat)

CMatKron Method (CMat)
Computes the Kronecker Product of this matrix with another matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Kron :
        m2 : CMat -> CMat

Parameters

m2
Type: Microsoft.Research.LiquidCMat
The right-hand side matrix in the Kronecker product.

Return Value

Type: CMat
The result of the Kronecker product
See Also

Reference

CMat Class
Kron Overload


CMat.Kron Method (Int32, FSharpOption(Boolean))

CMatKron Method (Int32, FSharpOptionBoolean)
Computes the Kronecker Product of this matrix with an identity matrix

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Kron :
        len : int *
        left : FSharpOption<bool> -> CMat

Parameters

len
Type: SystemInt32
The dimension of the identity matrix (N of NxN).
left
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option that, if true, specifies that the identity matrix should be on the left side of the Kronecker product. The default is false, which means that the identity is on the right.

Return Value

Type: CMat
The result of the Kronecker product
See Also

Reference

CMat Class
Kron Overload


CMat.Mul Method

CMatMul Method
Overload List
 | Name | Description
Public method | Mul(Double) | Scales this matrix by a constant multiplier. This matrix is updated in place, rather than a new matrix being created.
Public method | Mul(CMat) | Computes the product of this matrix with another matrix. This matrix is on the left-hand side of the product, and the argument matrix is on the right-hand side. This matrix must have the same number of columns as the other matrix has rows.
Public method | Mul(CVec) | Calculates the product of this matrix and a vector. The vector's length must match the numder of columns in this matrix.
Top
See Also

Reference

CMat Class


CMat.Mul Method (Double)

CMatMul Method (Double)
Scales this matrix by a constant multiplier. This matrix is updated in place, rather than a new matrix being created.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mul :
        mul : float -> CMat

Parameters

mul
Type: SystemDouble
The scale factor to multiply by.

Return Value

Type: CMat
This matrix, as updated after scaling
See Also

Reference

CMat Class
Mul Overload


CMat.Mul Method (CMat)

CMatMul Method (CMat)
Computes the product of this matrix with another matrix. This matrix is on the left-hand side of the product, and the argument matrix is on the right-hand side. This matrix must have the same number of columns as the other matrix has rows.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mul :
        m2 : CMat -> CMat

Parameters

m2
Type: Microsoft.Research.LiquidCMat
The second matrix.

Return Value

Type: CMat
The resulting product matrix.
See Also

Reference

CMat Class
Mul Overload


CMat.Mul Method (CVec)

CMatMul Method (CVec)
Calculates the product of this matrix and a vector. The vector's length must match the numder of columns in this matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mul :
        v : CVec -> CVec

Parameters

v
Type: Microsoft.Research.LiquidCVec
The vector to multiply

Return Value

Type: CVec
The resulting product vector
See Also

Reference

CMat Class
Mul Overload


CMat.Power Method

CMatPower Method
Computes an integer power of this matrix. NOTE: This destroys the contents of the current matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Power :
        n : int -> CMat

Parameters

n
Type: SystemInt32
The power to raise this matrix to; must be greater than 0.

Return Value

Type: CMat
The resulting matrix
See Also

Reference

CMat Class


CMat.Read Method

CMatRead Method
Reads a matrix from a stream.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Read :
        br : BinaryReader -> CMat

Parameters

br
Type: System.IOBinaryReader
A BinaryReader to deserialize a matrix from.

Return Value

Type: CMat
The new mnatrix
See Also

Reference

CMat Class


CMat.ToString Method

CMatToString Method
Gets a string representation of this matrix. Note that there is no limit on the size of the result; every row and column entry is included.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

CMat Class


CMat.UnitaryError Method

CMatUnitaryError Method
Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member UnitaryError : unit -> float

Return Value

Type: Double
The worst deviation from 1.
See Also

Reference

CMat Class


CMat.Write Method

CMatWrite Method
Writes this matrix to a stream for serialization.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Write :
        bw : BinaryWriter -> unit

Parameters

bw
Type: System.IOBinaryWriter
A BinaryWriter to serialize this matrix to.
See Also

Reference

CMat Class


CMat Operators

CMat Operators

The CMat type exposes the following members.

Operators
Name | Description
AdditionAssignment | Adds one matrix to another.
DivisionAssignment | Scales a matrix by a constant divisor. The matrix is updated in place, rather than a new matrix being created.
Multiply(CMat, CMat) | Computes the product of two matrices. The first matrix must have the same number of columns as the second matrix has rows.
Multiply(CMat, CVec) | Computes the product of a matrix and a vector. The vector's length must match the numder of columns in the matrix.
MultiplyAssignment | Scales a matrix by a constant multiplier. The matrix is updated in place, rather than a new matrix being created.
MultiplyBang | Computes the Kronecker product of two matrices
Top
See Also

Reference

CMat Class


CMat.AdditionAssignment Operator

CMatAdditionAssignment Operator
Adds one matrix to another.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

m1
Type: Microsoft.Research.LiquidCMat
The left matrix. This matrix is modified.
m2
Type: Microsoft.Research.LiquidCMat
The right matrix
See Also

Reference

CMat Class


CMat.DivisionAssignment Operator

CMatDivisionAssignment Operator
Scales a matrix by a constant divisor. The matrix is updated in place, rather than a new matrix being created.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

m1
Type: Microsoft.Research.LiquidCMat
The matrix to scale.
div
Type: SystemDouble
The scale divisor. The matrix is multiplied by 1/div.
See Also

Reference

CMat Class


CMat.Multiply Operator

CMatMultiply Operator
Overload List
Name | Description
Multiply(CMat, CMat) | Computes the product of two matrices. The first matrix must have the same number of columns as the second matrix has rows.
Multiply(CMat, CVec) | Computes the product of a matrix and a vector. The vector's length must match the numder of columns in the matrix.
Top
See Also

Reference

CMat Class


CMat.Multiply Operator (CMat, CMat)

CMatMultiply Operator (CMat, CMat)
Computes the product of two matrices. The first matrix must have the same number of columns as the second matrix has rows.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        m1 : CMat *
        m2 : CMat  : CMat

Parameters

m1
Type: Microsoft.Research.LiquidCMat
The left (first) matrix
m2
Type: Microsoft.Research.LiquidCMat
The right (second) matrix

Return Value

Type: CMat
The resulting product matrix
See Also

Reference

CMat Class
Multiply Overload


CMat.Multiply Operator (CMat, CVec)

CMatMultiply Operator (CMat, CVec)
Computes the product of a matrix and a vector. The vector's length must match the numder of columns in the matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        m : CMat *
        v : CVec  : CVec

Parameters

m
Type: Microsoft.Research.LiquidCMat
The matrix
v
Type: Microsoft.Research.LiquidCVec
The vector

Return Value

Type: CVec
The resulting product vector
See Also

Reference

CMat Class
Multiply Overload


CMat.MultiplyAssignment Operator

CMatMultiplyAssignment Operator
Scales a matrix by a constant multiplier. The matrix is updated in place, rather than a new matrix being created.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

m1
Type: Microsoft.Research.LiquidCMat
The matrix to scale.
mul
Type: SystemDouble
The constant to multiply by.
See Also

Reference

CMat Class


CMat.MultiplyBang Operator

CMatMultiplyBang Operator
Computes the Kronecker product of two matrices

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

m1
Type: Microsoft.Research.LiquidCMat
The left matrix
m2
Type: Microsoft.Research.LiquidCMat
The right matrix

Return Value

Type: CMat
The result of the Kronecker product
See Also

Reference

CMat Class


Complex Structure

Complex Structure
Data type for complex numbers.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type Complex =
    struct
        interface IEquatable<Complex>
        interface IStructuralEquatable
        interface IComparable<Complex>
        interface IComparable
        interface IStructuralComparable
    end

The Complex type exposes the following members.

Constructors
 | Name | Description
Public method | Complex | Constructs a complex number from its real and imaginary parts.
Top
Properties
 | Name | Description
Public property | i | Gets the imaginary part of this Complex number.
 | I | The square root of negative one, as a Complex number.
Public property | MCC | Gets the squared magnitude of this Complex number.
 | One | One, as a Complex number
Public property | r | Gets the real part of this Complex number.
 | Tol | Tolerance for comparing two Complex numbers. This is used in various places in the system.
 | Zero | Zero, as a Complex number
Top
Methods
 | Name | Description
Public method | Conj | Computes the complex conjugate of this Complex number.
Public method | Copy | Duplicates this Complex number in a new instance.
Public method | Dump | Dumps this Complex number to the console and log with an optional indentation.
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Narrow | Converts this Complex number to a short human-readable string.
Public method | ToString | Converts this Complex number to a human-readable string. (Overrides ValueTypeToString.)
Public method | Wide | Converts this Complex number to a string suitable for input to other programs.
Top
Operators
Name | Description
Addition | Adds two Complex numbers.
Multiply(Double, Complex) | Multiplies a real and a Complex number.
Multiply(Complex, Complex) | Multiplies two Complex numbers.
Multiply(Complex, Double) | Multiplies a Complex and a real number.
Subtraction | Subtracts one Complex number from another.
TwiddleTwiddle | Gets the complex conjugate of a Complex number.
UnaryNegation | Gets the negation of a Complex number.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Complex Constructor

Complex Constructor
Constructs a complex number from its real and imaginary parts.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        r : float *
        i : float -> Complex

Parameters

r
Type: SystemDouble
Real value
i
Type: SystemDouble
Imaginary value
See Also

Reference

Complex Structure


Complex Properties

Complex Properties

The Complex type exposes the following members.

Properties
 | Name | Description
Public property | i | Gets the imaginary part of this Complex number.
 | I | The square root of negative one, as a Complex number.
Public property | MCC | Gets the squared magnitude of this Complex number.
 | One | One, as a Complex number
Public property | r | Gets the real part of this Complex number.
 | Tol | Tolerance for comparing two Complex numbers. This is used in various places in the system.
 | Zero | Zero, as a Complex number
Top
See Also

Reference

Complex Structure


Complex.i Property

Complexi Property
Gets the imaginary part of this Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member i : float with get

Property Value

Type: Double
The imaginary part
See Also

Reference

Complex Structure


Complex.I Property

ComplexI Property
The square root of negative one, as a Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member I : Complex with get

Property Value

Type: Complex
See Also

Reference

Complex Structure


Complex.MCC Property

ComplexMCC Property
Gets the squared magnitude of this Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member MCC : float with get

Return Value

Type: Double
The squared magnitude (r*r+i*i)
See Also

Reference

Complex Structure


Complex.One Property

ComplexOne Property
One, as a Complex number

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member One : Complex with get

Property Value

Type: Complex
See Also

Reference

Complex Structure


Complex.r Property

Complexr Property
Gets the real part of this Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member r : float with get

Property Value

Type: Double
The real part
See Also

Reference

Complex Structure


Complex.Tol Property

ComplexTol Property
Tolerance for comparing two Complex numbers. This is used in various places in the system.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Tol : float with get, set

Property Value

Type: Double
See Also

Reference

Complex Structure


Complex.Zero Property

ComplexZero Property
Zero, as a Complex number

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Zero : Complex with get

Property Value

Type: Complex
See Also

Reference

Complex Structure


Complex Methods

Complex Methods

The Complex type exposes the following members.

Methods
 | Name | Description
Public method | Conj | Computes the complex conjugate of this Complex number.
Public method | Copy | Duplicates this Complex number in a new instance.
Public method | Dump | Dumps this Complex number to the console and log with an optional indentation.
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Narrow | Converts this Complex number to a short human-readable string.
Public method | ToString | Converts this Complex number to a human-readable string. (Overrides ValueTypeToString.)
Public method | Wide | Converts this Complex number to a string suitable for input to other programs.
Top
See Also

Reference

Complex Structure


Complex.Conj Method

ComplexConj Method
Computes the complex conjugate of this Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Conj : unit -> Complex

Return Value

Type: Complex
The conjugate
See Also

Reference

Complex Structure


Complex.Copy Method

ComplexCopy Method
Duplicates this Complex number in a new instance.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> Complex

Return Value

Type: Complex
The new Complex
See Also

Reference

Complex Structure


Complex.Dump Method

ComplexDump Method
Dumps this Complex number to the console and log with an optional indentation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Complex Structure


Complex.Narrow Method

ComplexNarrow Method
Converts this Complex number to a short human-readable string.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Narrow : unit -> string

Return Value

Type: String
The formatted string representation
See Also

Reference

Complex Structure


Complex.ToString Method

ComplexToString Method
Converts this Complex number to a human-readable string.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The formatted string representation
See Also

Reference

Complex Structure


Complex.Wide Method

ComplexWide Method
Converts this Complex number to a string suitable for input to other programs.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Wide : unit -> string

Return Value

Type: String
The formatted string representation
See Also

Reference

Complex Structure


Complex Operators

Complex Operators

The Complex type exposes the following members.

Operators
Name | Description
Addition | Adds two Complex numbers.
Multiply(Double, Complex) | Multiplies a real and a Complex number.
Multiply(Complex, Complex) | Multiplies two Complex numbers.
Multiply(Complex, Double) | Multiplies a Complex and a real number.
Subtraction | Subtracts one Complex number from another.
TwiddleTwiddle | Gets the complex conjugate of a Complex number.
UnaryNegation | Gets the negation of a Complex number.
Top
See Also

Reference

Complex Structure


Complex.Addition Operator

ComplexAddition Operator
Adds two Complex numbers.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (+)
        a : Complex *
        b : Complex  : Complex

Parameters

a
Type: Microsoft.Research.LiquidComplex
The left-hand operand
b
Type: Microsoft.Research.LiquidComplex
The right-hand operand

Return Value

Type: Complex
NThe sum of the two operands
See Also

Reference

Complex Structure


Complex.Multiply Operator

ComplexMultiply Operator
Overload List
Name | Description
Multiply(Double, Complex) | Multiplies a real and a Complex number.
Multiply(Complex, Complex) | Multiplies two Complex numbers.
Multiply(Complex, Double) | Multiplies a Complex and a real number.
Top
See Also

Reference

Complex Structure


Complex.Multiply Operator (Double, Complex)

ComplexMultiply Operator (Double, Complex)
Multiplies a real and a Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        a : float *
        b : Complex  : Complex

Parameters

a
Type: SystemDouble
The real number
b
Type: Microsoft.Research.LiquidComplex
The Complex number

Return Value

Type: Complex
The product of the two numbers
See Also

Reference

Complex Structure
Multiply Overload


Complex.Multiply Operator (Complex, Complex)

ComplexMultiply Operator (Complex, Complex)
Multiplies two Complex numbers.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        a : Complex *
        b : Complex  : Complex

Parameters

a
Type: Microsoft.Research.LiquidComplex
Left hand operand.
b
Type: Microsoft.Research.LiquidComplex
Right hand operand.

Return Value

Type: Complex
The product of the two numbers
See Also

Reference

Complex Structure
Multiply Overload


Complex.Multiply Operator (Complex, Double)

ComplexMultiply Operator (Complex, Double)
Multiplies a Complex and a real number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        a : Complex *
        b : float  : Complex

Parameters

a
Type: Microsoft.Research.LiquidComplex
The Complex number
b
Type: SystemDouble
The real number

Return Value

Type: Complex
The product of the two numbers
See Also

Reference

Complex Structure
Multiply Overload


Complex.Subtraction Operator

ComplexSubtraction Operator
Subtracts one Complex number from another.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (-)
        a : Complex *
        b : Complex  : Complex

Parameters

a
Type: Microsoft.Research.LiquidComplex
The left-hand operand
b
Type: Microsoft.Research.LiquidComplex
The right-hand operand

Return Value

Type: Complex
The difference of the two operands
See Also

Reference

Complex Structure


Complex.TwiddleTwiddle Operator

ComplexTwiddleTwiddle Operator
Gets the complex conjugate of a Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

a
Type: Microsoft.Research.LiquidComplex
The Complex number to conjugate.

Return Value

Type: Complex
The conjugated Complex number
See Also

Reference

Complex Structure


Complex.UnaryNegation Operator

ComplexUnaryNegation Operator
Gets the negation of a Complex number.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (-)
        a : Complex  : Complex

Parameters

a
Type: Microsoft.Research.LiquidComplex
The Complex number to negate

Return Value

Type: Complex
The negated Complex number, (-r,-i)
See Also

Reference

Complex Structure


CSMat Class

CSMat Class
A sparse matrix of complex numbers.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidCSMat

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type CSMat =  class end

The CSMat type exposes the following members.

Constructors
 | Name | Description
Public method | CSMat(Int32, FSharpListTupleInt32, Int32, Double, Double) | Creates a matrix from a list of elements.
Public method | CSMat(Int32, FSharpOptionBoolean) | Creates a new square identity or zero matrix.
Public method | CSMat(CMat, FSharpOptionDouble) | Creates a sparse matrix from a dense matrix.
Top
Properties
 | Name | Description
Public property | Item | Gets an element of the matrix.
Public property | Length | The dimension of this matrix; that is, the number of rows or columns.
Top
Methods
 | Name | Description
Public method | Adj | Computes the adjoint (complex conjugate transpose) of this matrix.
Public method | Clear | Clears out this matrix, setting all elements to zero.
Public method | Copy | Makes a copy of this matrix.
Public method | Dense | Creates a dense matrix from this sparse matrix.
Public method | Dump | Dumps this matrix as a list of row-column indices and element complex values. Note that all non-zero elements are listed, so the output may be quite long.
Public method | DumpDense | Dumps this sparse matrix in the same format as a dense matrix.
Public method | DumpMCC | Dumps this matrix as a list of row-column indices and element squared magnitudes. Note that all non-zero elements are listed, so the output may be quite long.
Public method | DumpML | Dumps this matrix in MatLab format.
Public method | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | Equals(CSMat, FSharpOptionDouble) | Determines whether this matrix is equal to another.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kron(Int32) | Computes the Kronecker Product of this matrix with an identity matrix. The identity matrix is on the right-hand side of the product.
Public method | Kron(CSMat) | Computes the Kronecker Product of this matrix with another matrix.
Public method | Mul(CSMat) | Computes the product of this matrix and another matrix. Highly efficient.
Public method | Mul(CVec) | Computes the product of this matric and a vector.
 | Read | Reads a matrix from a stream. The matrix must originally have been written using the Write method.
Public method | ToString | Gets a string representation of this matrix. Note that all non-zero elements are listed, so this string may be quite long. (Overrides ObjectToString.)
Public method | UnitaryError | Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.
Public method | Write | Writes this matrix to a stream. The matrix may be recreated by using the Read method.
Top
Operators
Name | Description
Multiply(CSMat, CSMat) | Computes the product of two matrices. Highly efficient.
Multiply(CSMat, CVec) | Computes the product of a matrix and a vector.
MultiplyBang | Computes the Kronecker product of two matrices
Top
See Also

Reference

Microsoft.Research.Liquid Namespace
[T::Microsoft.Research.Liquid.CMat]


CSMat Constructor

CSMat Constructor
Overload List
 | Name | Description
Public method | CSMat(Int32, FSharpListTupleInt32, Int32, Double, Double) | Creates a matrix from a list of elements.
Public method | CSMat(Int32, FSharpOptionBoolean) | Creates a new square identity or zero matrix.
Public method | CSMat(CMat, FSharpOptionDouble) | Creates a sparse matrix from a dense matrix.
Top
See Also

Reference

CSMat Class


CSMat Constructor (Int32, FSharpList(Tuple(Int32, Int32, Double, Double)))

CSMat Constructor (Int32, FSharpListTupleInt32, Int32, Double, Double)
Creates a matrix from a list of elements.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        len : int *
        xyris : FSharpList<Tuple<int, int, float, float>> -> CSMat

Parameters

len
Type: SystemInt32
The dimension of the matrix; that is, the row or column count.
xyris
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32, Double, Double
A list of elements. Each element should be a tuple in the form (row,col,real,imag).
See Also

Reference

CSMat Class
CSMat Overload


CSMat Constructor (Int32, FSharpOption(Boolean))

CSMat Constructor (Int32, FSharpOptionBoolean)
Creates a new square identity or zero matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        n : int *
        zero : FSharpOption<bool> -> CSMat

Parameters

n
Type: SystemInt32
The dimension of the matrix; that is, the row or column count.
zero
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to create a zero matrix rather than an identity matrix, if true. The default is false, which creates an identity matrix.
See Also

Reference

CSMat Class
CSMat Overload


CSMat Constructor (CMat, FSharpOption(Double))

CSMat Constructor (CMat, FSharpOptionDouble)
Creates a sparse matrix from a dense matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        m : CMat *
        tol : FSharpOption<float> -> CSMat

Parameters

m
Type: Microsoft.Research.LiquidCMat
The source matrix.
tol
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional tolerance for identifying zero elements. The default is to use Complex.tol as the maximum magnitude to consider 0.
See Also

Reference

CSMat Class
CSMat Overload


CSMat Properties

CSMat Properties

The CSMat type exposes the following members.

Properties
 | Name | Description
Public property | Item | Gets an element of the matrix.
Public property | Length | The dimension of this matrix; that is, the number of rows or columns.
Top
See Also

Reference

CSMat Class


CSMat.Item Property

CSMatItem Property
Gets an element of the matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Item : Complex with get, set

Parameters

x
Type: SystemInt32
The row index of the desired element.
y
Type: SystemInt32
The column index of the desired element.

Return Value

Type: Complex
The matrix element, as a Complex number
See Also

Reference

CSMat Class


CSMat.Length Property

CSMatLength Property
The dimension of this matrix; that is, the number of rows or columns.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Length : int with get

Property Value

Type: Int32
See Also

Reference

CSMat Class


CSMat Methods

CSMat Methods

The CSMat type exposes the following members.

Methods
 | Name | Description
Public method | Adj | Computes the adjoint (complex conjugate transpose) of this matrix.
Public method | Clear | Clears out this matrix, setting all elements to zero.
Public method | Copy | Makes a copy of this matrix.
Public method | Dense | Creates a dense matrix from this sparse matrix.
Public method | Dump | Dumps this matrix as a list of row-column indices and element complex values. Note that all non-zero elements are listed, so the output may be quite long.
Public method | DumpDense | Dumps this sparse matrix in the same format as a dense matrix.
Public method | DumpMCC | Dumps this matrix as a list of row-column indices and element squared magnitudes. Note that all non-zero elements are listed, so the output may be quite long.
Public method | DumpML | Dumps this matrix in MatLab format.
Public method | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | Equals(CSMat, FSharpOptionDouble) | Determines whether this matrix is equal to another.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kron(Int32) | Computes the Kronecker Product of this matrix with an identity matrix. The identity matrix is on the right-hand side of the product.
Public method | Kron(CSMat) | Computes the Kronecker Product of this matrix with another matrix.
Public method | Mul(CSMat) | Computes the product of this matrix and another matrix. Highly efficient.
Public method | Mul(CVec) | Computes the product of this matric and a vector.
 | Read | Reads a matrix from a stream. The matrix must originally have been written using the Write method.
Public method | ToString | Gets a string representation of this matrix. Note that all non-zero elements are listed, so this string may be quite long. (Overrides ObjectToString.)
Public method | UnitaryError | Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.
Public method | Write | Writes this matrix to a stream. The matrix may be recreated by using the Read method.
Top
See Also

Reference

CSMat Class


CSMat.Adj Method

CSMatAdj Method
Computes the adjoint (complex conjugate transpose) of this matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Adj : unit -> CSMat

Return Value

Type: CSMat
A new matrix that is the adjoint of this matrix
See Also

Reference

CSMat Class


CSMat.Clear Method

CSMatClear Method
Clears out this matrix, setting all elements to zero.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Clear : unit -> unit
See Also

Reference

CSMat Class


CSMat.Copy Method

CSMatCopy Method
Makes a copy of this matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> CSMat

Return Value

Type: CSMat
The new matrix
See Also

Reference

CSMat Class


CSMat.Dense Method

CSMatDense Method
Creates a dense matrix from this sparse matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dense :
        zeros : FSharpOption<bool> -> CMat

Parameters

zeros
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
Option to create a dense matrix the same size as this matrix but filled with zeroes, rather than copying this matrix. The default is to copy the entries of this matrix to the new dense matrix.

Return Value

Type: CMat
The new dense matrix
See Also

Reference

CSMat Class


CSMat.Dump Method

CSMatDump Method
Dumps this matrix as a list of row-column indices and element complex values. Note that all non-zero elements are listed, so the output may be quite long.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

CSMat Class


CSMat.DumpDense Method

CSMatDumpDense Method
Dumps this sparse matrix in the same format as a dense matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpDense :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

CSMat Class


CSMat.DumpMCC Method

CSMatDumpMCC Method
Dumps this matrix as a list of row-column indices and element squared magnitudes. Note that all non-zero elements are listed, so the output may be quite long.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpMCC :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

CSMat Class


CSMat.DumpML Method

CSMatDumpML Method
Dumps this matrix in MatLab format.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpML :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        nam : FSharpOption<string> *
        idxOffset : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
nam
Type: Microsoft.FSharp.CoreFSharpOptionString
An optional name for the matrix. The default is A.
idxOffset
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional number of rows and columns to skip. If this is not zero, then the square submatrix starting at this offset is dumped instead of the full matrix. The default is 0.
See Also

Reference

CSMat Class


CSMat.Equals Method

CSMatEquals Method
Overload List
 | Name | Description
Public method | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | Equals(CSMat, FSharpOptionDouble) | Determines whether this matrix is equal to another.
Top
See Also

Reference

CSMat Class


CSMat.Equals Method (CSMat, FSharpOption(Double))

CSMatEquals Method (CSMat, FSharpOptionDouble)
Determines whether this matrix is equal to another.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Equals :
        m2 : CSMat *
        tol : FSharpOption<float> -> bool

Parameters

m2
Type: Microsoft.Research.LiquidCSMat
The sparse matrix to compare to.
tol
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional tolerance for considering real or imaginary parts equal. The default is Complex.Tol.

Return Value

Type: Boolean
true if the matrices are equal, within the tolerance limit, or false otherwise.
See Also

Reference

CSMat Class
Equals Overload


CSMat.Kron Method

CSMatKron Method
Overload List
 | Name | Description
Public method | Kron(Int32) | Computes the Kronecker Product of this matrix with an identity matrix. The identity matrix is on the right-hand side of the product.
Public method | Kron(CSMat) | Computes the Kronecker Product of this matrix with another matrix.
Top
See Also

Reference

CSMat Class


CSMat.Kron Method (Int32)

CSMatKron Method (Int32)
Computes the Kronecker Product of this matrix with an identity matrix. The identity matrix is on the right-hand side of the product.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Kron :
        lenI : int -> CSMat

Parameters

lenI
Type: SystemInt32
The dimension of the identity matrix (N of NxN).

Return Value

Type: CSMat
The result of the Kronecker product
See Also

Reference

CSMat Class
Kron Overload


CSMat.Kron Method (CSMat)

CSMatKron Method (CSMat)
Computes the Kronecker Product of this matrix with another matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Kron :
        m2 : CSMat -> CSMat

Parameters

m2
Type: Microsoft.Research.LiquidCSMat
The right-hand side matrix in the Kronecker product.

Return Value

Type: CSMat
The result of the Kronecker product
See Also

Reference

CSMat Class
Kron Overload


CSMat.Mul Method

CSMatMul Method
Overload List
 | Name | Description
Public method | Mul(CSMat) | Computes the product of this matrix and another matrix. Highly efficient.
Public method | Mul(CVec) | Computes the product of this matric and a vector.
Top
See Also

Reference

CSMat Class


CSMat.Mul Method (CSMat)

CSMatMul Method (CSMat)
Computes the product of this matrix and another matrix. Highly efficient.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mul :
        m2 : CSMat -> CSMat

Parameters

m2
Type: Microsoft.Research.LiquidCSMat
The right-hand matrix to be multiplied by this matrix.

Return Value

Type: CSMat
New resulting sparse matrix
See Also

Reference

CSMat Class
Mul Overload


CSMat.Mul Method (CVec)

CSMatMul Method (CVec)
Computes the product of this matric and a vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mul :
        v : CVec -> CVec

Parameters

v
Type: Microsoft.Research.LiquidCVec
The vector to multiply.

Return Value

Type: CVec
The resulting vector
See Also

Reference

CSMat Class
Mul Overload


CSMat.Read Method

CSMatRead Method
Reads a matrix from a stream. The matrix must originally have been written using the Write method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Read :
        br : BinaryReader -> CSMat

Parameters

br
Type: System.IOBinaryReader
The stream to read the data from.

Return Value

Type: CSMat
The read-in matrix
See Also

Reference

CSMat Class


CSMat.ToString Method

CSMatToString Method
Gets a string representation of this matrix. Note that all non-zero elements are listed, so this string may be quite long.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

CSMat Class


CSMat.UnitaryError Method

CSMatUnitaryError Method
Performs a rough check to see if this matrix is actually unitary. It calculates the biggest deviation from 1 of the diagonal elements of (this adj)*this. In other words, it calculates the largest deviation of the length of a row, viewed as a complex vector, from 1. The orthogonality of different rows is not checked.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member UnitaryError : unit -> float

Return Value

Type: Double
The worst deviation from 1.
See Also

Reference

CSMat Class


CSMat.Write Method

CSMatWrite Method
Writes this matrix to a stream. The matrix may be recreated by using the Read method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Write :
        bw : BinaryWriter -> unit

Parameters

bw
Type: System.IOBinaryWriter
The stream to serialize this matrix to
See Also

Reference

CSMat Class


CSMat Operators

CSMat Operators

The CSMat type exposes the following members.

Operators
Name | Description
Multiply(CSMat, CSMat) | Computes the product of two matrices. Highly efficient.
Multiply(CSMat, CVec) | Computes the product of a matrix and a vector.
MultiplyBang | Computes the Kronecker product of two matrices
Top
See Also

Reference

CSMat Class


CSMat.Multiply Operator

CSMatMultiply Operator
Overload List
Name | Description
Multiply(CSMat, CSMat) | Computes the product of two matrices. Highly efficient.
Multiply(CSMat, CVec) | Computes the product of a matrix and a vector.
Top
See Also

Reference

CSMat Class


CSMat.Multiply Operator (CSMat, CSMat)

CSMatMultiply Operator (CSMat, CSMat)
Computes the product of two matrices. Highly efficient.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        m1 : CSMat *
        m2 : CSMat  : CSMat

Parameters

m1
Type: Microsoft.Research.LiquidCSMat
The left-hand matrix.
m2
Type: Microsoft.Research.LiquidCSMat
THe right-hand matrix.

Return Value

Type: CSMat
The resulting product matrix
See Also

Reference

CSMat Class
Multiply Overload


CSMat.Multiply Operator (CSMat, CVec)

CSMatMultiply Operator (CSMat, CVec)
Computes the product of a matrix and a vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static let inline (*)
        m : CSMat *
        v : CVec  : CVec

Parameters

m
Type: Microsoft.Research.LiquidCSMat
The matrix
v
Type: Microsoft.Research.LiquidCVec
The vector

Return Value

Type: CVec
The resulting vector
See Also

Reference

CSMat Class
Multiply Overload


CSMat.MultiplyBang Operator

CSMatMultiplyBang Operator
Computes the Kronecker product of two matrices

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

m1
Type: Microsoft.Research.LiquidCSMat
The left matrix
m2
Type: Microsoft.Research.LiquidCSMat
The right matrix

Return Value

Type: CSMat
The result of the Kronecker product
See Also

Reference

CSMat Class


CVec Class

CVec Class
A block-sparse vector of complex numbers.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidCVec

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type CVec =  class end

The CVec type exposes the following members.

Constructors
 | Name | Description
Public method | CVec(UInt64, Boolean) | Creates a new vector filled with zeroes.
Public method | CVec(Double, FSharpOptionDouble, FSharpOptionBoolean) | Creates a new vector from initial value vectors, real and imaginary. Note that the length of the new vector must be no more than 2^20.
Public method | CVec(UInt64, FSharpOptionDouble, FSharpOptionDouble, FSharpOptionBoolean) | Creates a new vector. By default, the vector is all zero. Optionally, the real and impaginary initial values may be provided; in this case, the vector must be no more than 2^20 in length.
Top
Properties
 | Name | Description
Public property | iSafe | Gets the imaginary part of an element of this vector by index.
Public property | Length | The length of this vector
Public property | rSafe | Gets the real part of an element of this vector by index.
Public property | Safe | Gets an element of this vector by index.
Top
Methods
 | Name | Description
Public method | AddMCC | Calculates the norm of this vector. The norm is the square root of the sum of the complex magnitudes of the vector elements.
Public method | Copy | Creates an exact copy of this vector.
Public method | Dump | Dumps this vector using the provided function.
Public method | DumpMCC | Dump vector MCC with provided function
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GlobalPhase | Estimates the global phase of a vector that represents a quantum state. The estimate is computed as the complex phase of the vector element with the greatest amplitude.
Public method | Kron | Computes the Kronecker product of this vector and another.
Public method | Normalize | Normalizes this vector to length 1.0.
 | Read | Reads a new vector from a binary file. Note that this routine is only intended to read vectors written with the Write method.
Public method | Scale | Scale all elements of the vector (unsafe)
Public method | ToString | Converts this vector to a string. At most the first 512 entries are displayed. (Overrides ObjectToString.)
Public method | Write | Writes this vector to a binary file.
Public method | Zero | Zeroes this vector. Note that this also densely fills in the vector.
Top
Operators
Name | Description
MultiplyBang | Computes the Kronecker product of two vectors.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


CVec Constructor

CVec Constructor
Overload List
 | Name | Description
Public method | CVec(UInt64, Boolean) | Creates a new vector filled with zeroes.
Public method | CVec(Double, FSharpOptionDouble, FSharpOptionBoolean) | Creates a new vector from initial value vectors, real and imaginary. Note that the length of the new vector must be no more than 2^20.
Public method | CVec(UInt64, FSharpOptionDouble, FSharpOptionDouble, FSharpOptionBoolean) | Creates a new vector. By default, the vector is all zero. Optionally, the real and impaginary initial values may be provided; in this case, the vector must be no more than 2^20 in length.
Top
See Also

Reference

CVec Class


CVec Constructor (UInt64, Boolean)

CVec Constructor (UInt64, Boolean)
Creates a new vector filled with zeroes.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        _len : uint64 *
        force : bool -> CVec

Parameters

_len
Type: SystemUInt64
The length of the vector
force
Type: SystemBoolean
Option to force complete (non-sparse) allocation of the vector. The default to false, which leaves the vector sparse.
See Also

Reference

CVec Class
CVec Overload


CVec Constructor (Double[], FSharpOption(Double[]), FSharpOption(Boolean))

CVec Constructor (Double, FSharpOptionDouble, FSharpOptionBoolean)
Creates a new vector from initial value vectors, real and imaginary. Note that the length of the new vector must be no more than 2^20.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        rs : float[] *
        is : FSharpOption<float[]> *
        force : FSharpOption<bool> -> CVec

Parameters

rs
Type: SystemDouble
The vector of real initial values
is
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional vector of imaginary initial values; default is zero
force
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
Option to force complete (non-sparse) allocation of the vector; defaults to false
See Also

Reference

CVec Class
CVec Overload


CVec Constructor (UInt64, FSharpOption(Double[]), FSharpOption(Double[]), FSharpOption(Boolean))

CVec Constructor (UInt64, FSharpOptionDouble, FSharpOptionDouble, FSharpOptionBoolean)
Creates a new vector. By default, the vector is all zero. Optionally, the real and impaginary initial values may be provided; in this case, the vector must be no more than 2^20 in length.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        _len : uint64 *
        rsInit : FSharpOption<float[]> *
        isInit : FSharpOption<float[]> *
        forceAlloc : FSharpOption<bool> -> CVec

Parameters

_len
Type: SystemUInt64
The length of the vector
rsInit
Type: Microsoft.FSharp.CoreFSharpOptionDouble
Optional real parts of the initial values; if provided, there must be an entry for each element in the vector. Default is zero.
isInit
Type: Microsoft.FSharp.CoreFSharpOptionDouble
Optional imaginary of the initial values; if provided, there must be an entry for each element in the vector. Default is zero.
forceAlloc
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
Option to force complete (non-sparse) allocation of the vector; defaults to false
See Also

Reference

CVec Class
CVec Overload


CVec Properties

CVec Properties

The CVec type exposes the following members.

Properties
 | Name | Description
Public property | iSafe | Gets the imaginary part of an element of this vector by index.
Public property | Length | The length of this vector
Public property | rSafe | Gets the real part of an element of this vector by index.
Public property | Safe | Gets an element of this vector by index.
Top
See Also

Reference

CVec Class


CVec.iSafe Property

CVeciSafe Property
Gets the imaginary part of an element of this vector by index.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member iSafe : float with get, set

Parameters

i
Type: SystemUInt64
The index of the element to get

Return Value

Type: Double
The imaginary part of the Complex value of the element
See Also

Reference

CVec Class


CVec.Length Property

CVecLength Property
The length of this vector

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Length : uint64 with get

Property Value

Type: UInt64
See Also

Reference

CVec Class


CVec.rSafe Property

CVecrSafe Property
Gets the real part of an element of this vector by index.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member rSafe : float with get, set

Parameters

i
Type: SystemUInt64
The index of the element to get

Return Value

Type: Double
The real part of the Complex value of the element
See Also

Reference

CVec Class


CVec.Safe Property

CVecSafe Property
Gets an element of this vector by index.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Safe : Complex with get, set

Parameters

i
Type: SystemUInt64
The index of the element to get

Return Value

Type: Complex
The Complex value of the element
See Also

Reference

CVec Class


CVec Methods

CVec Methods

The CVec type exposes the following members.

Methods
 | Name | Description
Public method | AddMCC | Calculates the norm of this vector. The norm is the square root of the sum of the complex magnitudes of the vector elements.
Public method | Copy | Creates an exact copy of this vector.
Public method | Dump | Dumps this vector using the provided function.
Public method | DumpMCC | Dump vector MCC with provided function
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GlobalPhase | Estimates the global phase of a vector that represents a quantum state. The estimate is computed as the complex phase of the vector element with the greatest amplitude.
Public method | Kron | Computes the Kronecker product of this vector and another.
Public method | Normalize | Normalizes this vector to length 1.0.
 | Read | Reads a new vector from a binary file. Note that this routine is only intended to read vectors written with the Write method.
Public method | Scale | Scale all elements of the vector (unsafe)
Public method | ToString | Converts this vector to a string. At most the first 512 entries are displayed. (Overrides ObjectToString.)
Public method | Write | Writes this vector to a binary file.
Public method | Zero | Zeroes this vector. Note that this also densely fills in the vector.
Top
See Also

Reference

CVec Class


CVec.AddMCC Method

CVecAddMCC Method
Calculates the norm of this vector. The norm is the square root of the sum of the complex magnitudes of the vector elements.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member AddMCC : unit -> float

Return Value

Type: Double
This vector's norm
See Also

Reference

CVec Class


CVec.Copy Method

CVecCopy Method
Creates an exact copy of this vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> CVec

Return Value

Type: CVec
The new vector
See Also

Reference

CVec Class


CVec.Dump Method

CVecDump Method
Dumps this vector using the provided function.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        maxNZ : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
maxNZ
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional maximum number of non-zeros to dump. The default is 256
See Also

Reference

CVec Class


CVec.DumpMCC Method

CVecDumpMCC Method
Dump vector MCC with provided function

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpMCC :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        thresh : FSharpOption<float> *
        both : FSharpOption<bool> *
        maxNZ : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
thresh
Type: Microsoft.FSharp.CoreFSharpOptionDouble
Output threshold (optional=tol*1.e+2)
both
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
Output complex value as well (optional=false)
maxNZ
Type: Microsoft.FSharp.CoreFSharpOptionInt32
Max non-zeros to dump (optional=256)
See Also

Reference

CVec Class


CVec.GlobalPhase Method

CVecGlobalPhase Method
Estimates the global phase of a vector that represents a quantum state. The estimate is computed as the complex phase of the vector element with the greatest amplitude.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member GlobalPhase : unit -> Tuple<float, Complex>

Return Value

Type: Tuple Double, Complex
A tuple whose first element is the estimated phase angle, in radians, and whose second element is the unit-magnitude Complex number with the opposite phase.
See Also

Reference

CVec Class


CVec.Kron Method

CVecKron Method
Computes the Kronecker product of this vector and another.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Kron :
        v2 : CVec -> CVec

Parameters

v2
Type: Microsoft.Research.LiquidCVec
Vector to multiply this one by

Return Value

Type: CVec
The result vector
See Also

Reference

CVec Class


CVec.Normalize Method

CVecNormalize Method
Normalizes this vector to length 1.0.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Normalize :
        len : FSharpOption<float> -> unit

Parameters

len
Type: Microsoft.FSharp.CoreFSharpOptionDouble
The optional current length, if already calculated. The default is to invoke and use the result of AddMCC
See Also

Reference

CVec Class


CVec.Read Method

CVecRead Method
Reads a new vector from a binary file. Note that this routine is only intended to read vectors written with the Write method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Read :
        br : BinaryReader -> CVec

Parameters

br
Type: System.IOBinaryReader
The BinaryReader from which the vector should be read.

Return Value

Type: CVec
The new vector
See Also

Reference

CVec Class
Microsoft.Research.Liquid Namespace
CVecWrite(BinaryWriter)


CVec.Scale Method

CVecScale Method
Scale all elements of the vector (unsafe)

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Scale :
        scale : Complex -> unit

Parameters

scale
Type: Microsoft.Research.LiquidComplex
Complex scale factor
See Also

Reference

CVec Class


CVec.ToString Method

CVecToString Method
Converts this vector to a string. At most the first 512 entries are displayed.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string
See Also

Reference

CVec Class


CVec.Write Method

CVecWrite Method
Writes this vector to a binary file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Write :
        bw : BinaryWriter -> unit

Parameters

bw
Type: System.IOBinaryWriter
The BinaryWriter that this vector should be written to.
See Also

Reference

CVec Class
Microsoft.Research.Liquid Namespace
CVecRead(BinaryReader)


CVec.Zero Method

CVecZero Method
Zeroes this vector. Note that this also densely fills in the vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Zero : unit -> unit
See Also

Reference

CVec Class


CVec Operators

CVec Operators

The CVec type exposes the following members.

Operators
Name | Description
MultiplyBang | Computes the Kronecker product of two vectors.
Top
See Also

Reference

CVec Class


CVec.MultiplyBang Operator

CVecMultiplyBang Operator
Computes the Kronecker product of two vectors.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

v1
Type: Microsoft.Research.LiquidCVec
Left vector
v2
Type: Microsoft.Research.LiquidCVec
Right vector

Return Value

Type: CVec
The result vector
See Also

Reference

CVec Class


Fermion Class

Fermion Class
Hamiltonian simulation for fermionic systems.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidHamiltonian
Microsoft.Research.LiquidFermion

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Fermion =
    class
        inherit Hamiltonian
    end

The Fermion type exposes the following members.

Constructors
 | Name | Description
Public method | Fermion(Double, Double, Int32, Int32, Int32, DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit) | Creates a new Fermion instance from a prebuilt Circuit.
Public method | Fermion(Double, Double, Int32, Int32, Int32, FSharpListTupleInt32, Int32, Double, FSharpListTupleInt32, Int32, Int32, Int32, Double, DictionaryString, String, FSharpOptionFSharpListInt32) | Creates a new Fermion instance from orbit overlap integrals.
Top
Properties
 | Name | Description
Public property | bits | The mumber of phase estimation bits. This is the bit precision plus two.
Public property | Circs | The built circuits, in bit order.
Public property | currentCirc | The last circuit that was run (ungrown).
Public property | decohereModel | The decoherence model for this Hamiltonian. (Inherited from Hamiltonian.)
Public property | eMax | The maximum energy for phase estimation.
Public property | eMin | The minimum energy for phase estimation.
Public property | Energy | The result of phase estimation, interpreted as an energy. This will always be between eMin and eMax. This value is only available after Run has been called.
Public property | Ket | Gets the Ket vector associated with this Hamiltonian (Inherited from Hamiltonian.)
Public property | omega | The energy range, eMax - eMin, for phase estimation.
Public property | order | The trotter order for phase estimation.
Public property | Phase | The result of phase estimation, as an angle between 0 and 2*pi. This value is only available after Run has been called.
Public property | trotterN | The trotter number for phase estimation.
Public property | tTotal | The total evolution time for phase estimation. This is equal to 2*p1/omega.
Public property | Ua | The gate function that implements a full Hamiltonian time step
Top
Methods
 | Name | Description
Public method | Build | Builds either a grown circuit or an exponentiated unitary.
Public method | Clean | Cleans out temporary files.
Public method | Dump | Dumps out information on this simulator.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | Load | Loads a Fermion test from a .dat file based on a script.
 | LoadOrbs | Loads orbital information from an array of strings.
Public method | PhaseSetup | Sets up phase estimation for all runs.
Public method | Prep | Prepares an initial state from the provided spin orbital indices.
Public method | Run(Boolean, FSharpOptionInt32) | Runs the simulation to obtain a phase estimate. A previous call to Build() or BuildSingle() is required.
 | Run(DictionaryString, String, String) | Runs a Fermion test from a .dat file, based on a script A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, String) | Runs a pre-loaded Fermion test based on a script. A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Ket) | Runs a Fermion test from a pre-built circuit and state vector. See the Users Manual for details on the parameters.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Remarks
This class simulates second-quantized models of electrons with a state space consisting of spin-up/spin-down pairs, with both one-body and two-body interactions.

In particular, this includes second-quantized quantum chemistry, where the state pairs are molecular orbitals, and the individual states are spin orbitals. In this case, the interaction terms come from various orbital overlap integrals. See the Users Manual for more detailed information.

See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Fermion Constructor

Fermion Constructor
Overload List
 | Name | Description
Public method | Fermion(Double, Double, Int32, Int32, Int32, DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit) | Creates a new Fermion instance from a prebuilt Circuit.
Public method | Fermion(Double, Double, Int32, Int32, Int32, FSharpListTupleInt32, Int32, Double, FSharpListTupleInt32, Int32, Int32, Int32, Double, DictionaryString, String, FSharpOptionFSharpListInt32) | Creates a new Fermion instance from orbit overlap integrals.
Top
See Also

Reference

Fermion Class


Fermion Constructor (Double, Double, Int32, Int32, Int32, Dictionary(String, String), FSharpFunc(Double, FSharpFunc(FSharpList(Qubit), Unit)))

Fermion Constructor (Double, Double, Int32, Int32, Int32, DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit)
Creates a new Fermion instance from a prebuilt Circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        eMin : float *
        eMax : float *
        trotterN : int *
        bits : int *
        order : int *
        dic : Dictionary<string, string> *
        Ua : FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, Unit>> -> Fermion

Parameters

eMin
Type: SystemDouble
The minimum energy to use for phase estimation.
eMax
Type: SystemDouble
The maximum energy to use for phase estimation.
trotterN
Type: SystemInt32
The Trotter number to use
bits
Type: SystemInt32
The number of bits of phase estimation accuracy desired.
order
Type: SystemInt32
The Trotter order, either 1 or 2 (first or second order).
dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
Ua
Type: Microsoft.FSharp.CoreFSharpFuncDouble, FSharpFuncFSharpListQubit , Unit
A gate, usually a wrapped Circuit, that implements the Hamiltonian. The gate's parameter is the time step to evolve by.
Remarks
The possible options to specify are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class
Fermion Overload


Fermion Constructor (Double, Double, Int32, Int32, Int32, FSharpList(Tuple(Int32, Int32, Double)), FSharpList(Tuple(Int32, Int32, Int32, Int32, Double)), Dictionary(String, String), FSharpOption(FSharpList(Int32)))

Fermion Constructor (Double, Double, Int32, Int32, Int32, FSharpListTupleInt32, Int32, Double, FSharpListTupleInt32, Int32, Int32, Int32, Double, DictionaryString, String, FSharpOptionFSharpListInt32)
Creates a new Fermion instance from orbit overlap integrals.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        eMin : float *
        eMax : float *
        trotterN : int *
        bits : int *
        order : int *
        ij : FSharpList<Tuple<int, int, float>> *
        ijkl : FSharpList<Tuple<int, int, int, int, float>> *
        dic : Dictionary<string, string> *
        preps : FSharpOption<FSharpList<int>> -> Fermion

Parameters

eMin
Type: SystemDouble
The minimum energy to use for phase estimation.
eMax
Type: SystemDouble
The maximum energy to use for phase estimation.
trotterN
Type: SystemInt32
The Trotter number to use
bits
Type: SystemInt32
The number of bits of phase estimation accuracy desired.
order
Type: SystemInt32
The Trotter order, either 1 or 2 (first or second order).
ij
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32, Double
A list of tuples for single-body orbital constants. Each tuple represents an Hpq term, and contains p, q, and the value of Hpq. Note that pp terms are included in this category.
ijkl
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32, Int32, Int32, Double
A list of tuples for two-body orbital constants. Each tuple represents an Hpqrs term, and contains p, q, r, s, and the value of Hpqrs. Note that pqqp and pqqr terms are included in this category.
dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
preps
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListInt32
An optional specification of a 1-based electron prep list, for diagonal fix-up. The default is no prep and no fix-up.
Remarks
The possible options to specify are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class
Fermion Overload


Fermion Properties

Fermion Properties

The Fermion type exposes the following members.

Properties
 | Name | Description
Public property | bits | The mumber of phase estimation bits. This is the bit precision plus two.
Public property | Circs | The built circuits, in bit order.
Public property | currentCirc | The last circuit that was run (ungrown).
Public property | decohereModel | The decoherence model for this Hamiltonian. (Inherited from Hamiltonian.)
Public property | eMax | The maximum energy for phase estimation.
Public property | eMin | The minimum energy for phase estimation.
Public property | Energy | The result of phase estimation, interpreted as an energy. This will always be between eMin and eMax. This value is only available after Run has been called.
Public property | Ket | Gets the Ket vector associated with this Hamiltonian (Inherited from Hamiltonian.)
Public property | omega | The energy range, eMax - eMin, for phase estimation.
Public property | order | The trotter order for phase estimation.
Public property | Phase | The result of phase estimation, as an angle between 0 and 2*pi. This value is only available after Run has been called.
Public property | trotterN | The trotter number for phase estimation.
Public property | tTotal | The total evolution time for phase estimation. This is equal to 2*p1/omega.
Public property | Ua | The gate function that implements a full Hamiltonian time step
Top
See Also

Reference

Fermion Class


Fermion.bits Property

Fermionbits Property
The mumber of phase estimation bits. This is the bit precision plus two.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member bits : int with get

Property Value

Type: Int32
See Also

Reference

Fermion Class


Fermion.Circs Property

FermionCircs Property
The built circuits, in bit order.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Circs : FSharpList<Circuit> with get

Property Value

Type: FSharpListCircuit
See Also

Reference

Fermion Class


Fermion.currentCirc Property

FermioncurrentCirc Property
The last circuit that was run (ungrown).

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member currentCirc : Circuit with get

Property Value

Type: Circuit
See Also

Reference

Fermion Class


Fermion.eMax Property

FermioneMax Property
The maximum energy for phase estimation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member eMax : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.eMin Property

FermioneMin Property
The minimum energy for phase estimation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member eMin : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.Energy Property

FermionEnergy Property
The result of phase estimation, interpreted as an energy. This will always be between eMin and eMax. This value is only available after Run has been called.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Energy : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.omega Property

Fermionomega Property
The energy range, eMax - eMin, for phase estimation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member omega : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.order Property

Fermionorder Property
The trotter order for phase estimation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member order : int with get

Property Value

Type: Int32
See Also

Reference

Fermion Class


Fermion.Phase Property

FermionPhase Property
The result of phase estimation, as an angle between 0 and 2*pi. This value is only available after Run has been called.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Phase : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.trotterN Property

FermiontrotterN Property
The trotter number for phase estimation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member trotterN : int with get, set

Property Value

Type: Int32
See Also

Reference

Fermion Class


Fermion.tTotal Property

FermiontTotal Property
The total evolution time for phase estimation. This is equal to 2*p1/omega.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member tTotal : float with get

Property Value

Type: Double
See Also

Reference

Fermion Class


Fermion.Ua Property

FermionUa Property
The gate function that implements a full Hamiltonian time step

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Ua : FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, Unit>> with get

Property Value

Type: FSharpFuncDouble, FSharpFuncFSharpListQubit , Unit
See Also

Reference

Fermion Class


Fermion Methods

Fermion Methods

The Fermion type exposes the following members.

Methods
 | Name | Description
Public method | Build | Builds either a grown circuit or an exponentiated unitary.
Public method | Clean | Cleans out temporary files.
Public method | Dump | Dumps out information on this simulator.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | Load | Loads a Fermion test from a .dat file based on a script.
 | LoadOrbs | Loads orbital information from an array of strings.
Public method | PhaseSetup | Sets up phase estimation for all runs.
Public method | Prep | Prepares an initial state from the provided spin orbital indices.
Public method | Run(Boolean, FSharpOptionInt32) | Runs the simulation to obtain a phase estimate. A previous call to Build() or BuildSingle() is required.
 | Run(DictionaryString, String, String) | Runs a Fermion test from a .dat file, based on a script A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, String) | Runs a pre-loaded Fermion test based on a script. A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Ket) | Runs a Fermion test from a pre-built circuit and state vector. See the Users Manual for details on the parameters.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Fermion Class


Fermion.Build Method

FermionBuild Method
Builds either a grown circuit or an exponentiated unitary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Build :
        gp : GrowPars -> unit

Parameters

gp
Type: Microsoft.Research.LiquidGrowPars
Grow parameters for Circuit.GrowGates. If the Single flag is set to true, then a single exponentiated unitary is built.
See Also

Reference

Fermion Class


Fermion.Clean Method

FermionClean Method
Cleans out temporary files.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Clean : unit -> unit
See Also

Reference

Fermion Class


Fermion.Dump Method

FermionDump Method
Dumps out information on this simulator.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Fermion Class


Fermion.Load Method

FermionLoad Method
Loads a Fermion test from a .dat file based on a script.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Load :
        dic : Dictionary<string, string> *
        dataFile : string -> string

Parameters

dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
dataFile
Type: SystemString
A relative or full path to the .dat file to load.

Return Value

Type: String
A single, multi-line string containing orbital information for the test number specified in the option dictionary. This string is suitable for passing (as the only element of an array) to LoadOrbs.
Remarks
The possible options to specify in the dictionary are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class


Fermion.LoadOrbs Method

FermionLoadOrbs Method
Loads orbital information from an array of strings.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LoadOrbs :
        dic : Dictionary<string, string> *
        data : string[] -> Tuple<FSharpList<Tuple<int, int, float>>, FSharpList<Tuple<int, int, int, int, float>>, string, float, float>

Parameters

dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
data
Type: SystemString
An array of formatted strings containing orbital information. Each string corresponds to a single line in a .dat file. The string format is described in the Users Manual.

Return Value

Type: Tuple FSharpListTuple Int32, Int32, Double , FSharpListTuple Int32, Int32, Int32, Int32, Double , String, Double, Double
A tuple containing the single-orbital terms; the two-orbital terms; an informational string; and the nuclear energy. The orbital terms are in the proper format to pass to the Fermion constructor.
Remarks
The possible options to specify in the dictionary are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class


Fermion.PhaseSetup Method

FermionPhaseSetup Method
Sets up phase estimation for all runs.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member PhaseSetup :
        bits : int *
        alterNoise : float *
        peType : string -> unit

Parameters

bits
Type: SystemInt32
The number of bits of phase estimation accuracy desired.
alterNoise
Type: SystemDouble
Magnitude of random (additive) noise to apply to evolution angles. Set this to 0.0 for no noise.
peType
Type: SystemString
The type of phase estimation to perform. Possible values are:
  • "circ": Basic PE on the full circuit
  • "expon": Create matrix exponentiations
  • "noise": Compute noise while running (uses a single Unitary)
  • "file": Serialize matrix exponentation to disk
  • "atan": Use arc tangent to go forward and do classical post processing
  • "default": Use type that naturally goes with specified GrowPars
See Also

Reference

Fermion Class


Fermion.Prep Method

FermionPrep Method
Prepares an initial state from the provided spin orbital indices.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Prep :
        prep : FSharpList<int> -> string

Parameters

prep
Type: Microsoft.FSharp.CollectionsFSharpListInt32
The list of spin orbitals to mark as occupied.

Return Value

Type: String
The "prep state" with exactly the listed orbitals occupied.
See Also

Reference

Fermion Class


Fermion.Run Method

FermionRun Method
Overload List
 | Name | Description
Public method | Run(Boolean, FSharpOptionInt32) | Runs the simulation to obtain a phase estimate. A previous call to Build() or BuildSingle() is required.
 | Run(DictionaryString, String, String) | Runs a Fermion test from a .dat file, based on a script A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, String) | Runs a pre-loaded Fermion test based on a script. A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.
 | Run(DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Ket) | Runs a Fermion test from a pre-built circuit and state vector. See the Users Manual for details on the parameters.
Top
See Also

Reference

Fermion Class


Fermion.Run Method (Boolean, FSharpOption(Int32))

FermionRun Method (Boolean, FSharpOptionInt32)
Runs the simulation to obtain a phase estimate. A previous call to Build() or BuildSingle() is required.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        single : bool *
        maxTries : FSharpOption<int> -> FSharpOption<int>

Parameters

single
Type: SystemBoolean
Whether or not this Hamiltonian is built into a single Unitary.
maxTries
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional maximum number of measurements to take. The default is 40.

Return Value

Type: FSharpOptionInt32
None if it succeeded, or Some (int bit position) if it failed.
See Also

Reference

Fermion Class
Run Overload


Fermion.Run Method (Dictionary(String, String), String)

FermionRun Method (DictionaryString, String, String)
Runs a Fermion test from a .dat file, based on a script A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Run :
        dic : Dictionary<string, string> *
        dataFile : string -> unit

Parameters

dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
dataFile
Type: SystemString
A relative or full path to the .dat file to load.
Remarks
The possible options to specify in the dictionary are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class
Run Overload


Fermion.Run Method (Dictionary(String, String), String[])

FermionRun Method (DictionaryString, String, String)
Runs a pre-loaded Fermion test based on a script. A basic axecution trace is sent to both the console and the log. Detailed information is sent just sent to the log. See the Users Manual for details on the parameters.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Run :
        dic : Dictionary<string, string> *
        data : string[] -> unit

Parameters

dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
data
Type: SystemString
An array of formatted strings containing orbital information. Each string corresponds to a single line in a .dat file. The string format is described in the Users Manual.
Remarks
The possible options to specify in the dictionary are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class
Run Overload


Fermion.Run Method (Dictionary(String, String), FSharpFunc(Double, FSharpFunc(FSharpList(Qubit), Unit)), Ket)

FermionRun Method (DictionaryString, String, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Ket)
Runs a Fermion test from a pre-built circuit and state vector. See the Users Manual for details on the parameters.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Run :
        dic : Dictionary<string, string> *
        Ua : FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, Unit>> *
        ket : Ket -> Tuple<int, Fermion>

Parameters

dic
Type: System.Collections.GenericDictionary String, String
A dictionary of options. See the Remarks for details.
Ua
Type: Microsoft.FSharp.CoreFSharpFuncDouble, FSharpFuncFSharpListQubit , Unit
A gate, usually a wrapped Circuit, that implements the Hamiltonian. The gate's parameter is the time step to evolve by.
ket
Type: Microsoft.Research.LiquidKet
The state vector to use as the initial state.

Return Value

Type: Tuple Int32, Fermion
A tuple of the phase estimation error bit, which will be -1 if no error occured, and the Fermion instance that was run. The Phase and Energy properties of the Fermion instance may be read to get the phase estimation results.
Remarks
The possible options to specify in the dictionary are: ... For more information, see the Users Manual.
See Also

Reference

Fermion Class
Run Overload


Gate Class

Gate Class
A quantum gate.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidGate

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Gate =  class end

The Gate type exposes the following members.

Constructors
 | Name | Description
Public method | Gate | Creates a new gate from scratch.
Top
Properties
 | Name | Description
Public property | Arity | The arity of the gate.
 | CacheDisable | Whether or not the gate cache is disabled. The cache is used if this property is false. The cache should be disabled if gates are being built in parallel.
Public property | Draw | The drawing instructions for this gate.
Public property | Help | The help string for this gate.
Public property | Mat | The unitary matrix for this gate. If the gate is not defined by a unitary, this will be a 0x0 matrix.
Public property | Name | The name of this gate.
Public property | Op | This gate's operation.
Public property | Parent | This gate's parent, if any.
Public property | Qubits | The arity of this gate; that is, the number of qubits the gate operates on.
Public property | User | The user info associated with this gate, if any.
Top
Methods
Name Description
Public method AddControl
Creates a new gate by adding one or more control qubits to an existing unitary gate.
Build
Gets the definition of a gate, using the cache. If the gate is already in the cache, the cached definition is returned. Otherwise, a new gate will be created, added to the cache, and returned.
CacheClear
Clears out the gate cache.
CacheStats
Gets gate cache statistics.
Public method Dump
Dumps the full gate information to the consol and/or log.
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method NewMat
Makes a new gate based on this gate but with new unitary matrix.
Public method Run
Run this gate. The details depend on the current value of Ket.Mode:
  • RunMode: Apply this gate operation to the supplied qubits.
  • GateMode: Stores this gate definition into the current Ket. This is for internal use.
  • CircMode: Compiles this gate into a Circuit. This is for internal use.
ShowMem(Int32, FSharpFuncUnit, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.
ShowMem(Int32, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.
Public method ToString
Returns a string representation of this gate, based on the gate's name, help string, and type.
(Overrides ObjectToString.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Gate Constructor

Gate Constructor
Creates a new gate from scratch.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        Name : FSharpOption<string> *
        Qubits : FSharpOption<int> *
        Mat : FSharpOption<CSMat> *
        Draw : FSharpOption<string> *
        Help : FSharpOption<string> *
        Op : FSharpOption<GateOp> *
        Parent : FSharpOption<FSharpOption<Gate>> *
        User : FSharpOption<FSharpOption<Object>> -> Gate

Parameters

Name
Type: Microsoft.FSharp.CoreFSharpOptionString
The optional name of the gate we're creating. The default is "".
Qubits
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional arity of gate; that is, the number of qubits this gate operates on. If a matrix for the gate is provided using the Mat parameter, then the arity is deduced from the dimensions of the matrix. The default value is 0.
Mat
Type: Microsoft.FSharp.CoreFSharpOptionCSMat
An optional sparse unitary matrix that implements the gate. This parameter is only used for gates that implement a unitary operation. The default is no unitary.
Draw
Type: Microsoft.FSharp.CoreFSharpOptionString
An optional string to use to render the gate. This should be a Q-Circuit drawing string, if provided. The default is "", which means that the gate doesn't show up when rendered.
Help
Type: Microsoft.FSharp.CoreFSharpOptionString
An optional help string for the gate. The default is no help string, "".
Op
Type: Microsoft.FSharp.CoreFSharpOptionGateOp
The optional gate operation to perform. The default is Normal, which is a unitary gate defined by a matrix.
Parent
Type: Microsoft.FSharp.CoreFSharpOptionFSharpOptionGate
The optional parent gate, if required by the gate operation type. The default is None.
User
Type: Microsoft.FSharp.CoreFSharpOptionFSharpOptionObject
An optional user-defined field.
See Also

Reference

Gate Class


Gate Properties

Gate Properties

The Gate type exposes the following members.

Properties
 | Name | Description
Public property | Arity | The arity of the gate.
 | CacheDisable | Whether or not the gate cache is disabled. The cache is used if this property is false. The cache should be disabled if gates are being built in parallel.
Public property | Draw | The drawing instructions for this gate.
Public property | Help | The help string for this gate.
Public property | Mat | The unitary matrix for this gate. If the gate is not defined by a unitary, this will be a 0x0 matrix.
Public property | Name | The name of this gate.
Public property | Op | This gate's operation.
Public property | Parent | This gate's parent, if any.
Public property | Qubits | The arity of this gate; that is, the number of qubits the gate operates on.
Public property | User | The user info associated with this gate, if any.
Top
See Also

Reference

Gate Class


Gate.Arity Property

GateArity Property
The arity of the gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Arity : int with get

Property Value

Type: Int32
See Also

Reference

Gate Class


Gate.CacheDisable Property

GateCacheDisable Property
Whether or not the gate cache is disabled. The cache is used if this property is false. The cache should be disabled if gates are being built in parallel.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CacheDisable : bool with get, set

Property Value

Type: Boolean
See Also

Reference

Gate Class


Gate.Draw Property

GateDraw Property
The drawing instructions for this gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Draw : string with get

Property Value

Type: String
See Also

Reference

Gate Class


Gate.Help Property

GateHelp Property
The help string for this gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Help : string with get

Property Value

Type: String
See Also

Reference

Gate Class


Gate.Mat Property

GateMat Property
The unitary matrix for this gate. If the gate is not defined by a unitary, this will be a 0x0 matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Mat : CSMat with get

Property Value

Type: CSMat
See Also

Reference

Gate Class


Gate.Name Property

GateName Property
The name of this gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Name : string with get

Property Value

Type: String
See Also

Reference

Gate Class


Gate.Op Property

GateOp Property
This gate's operation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Op : GateOp with get

Property Value

Type: GateOp
See Also

Reference

Gate Class


Gate.Parent Property

GateParent Property
This gate's parent, if any.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Parent : FSharpOption<Gate> with get

Property Value

Type: FSharpOptionGate
See Also

Reference

Gate Class


Gate.Qubits Property

GateQubits Property
The arity of this gate; that is, the number of qubits the gate operates on.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Qubits : int with get

Property Value

Type: Int32
See Also

Reference

Gate Class


Gate.User Property

GateUser Property
The user info associated with this gate, if any.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member User : FSharpOption<Object> with get

Property Value

Type: FSharpOptionObject
See Also

Reference

Gate Class


Gate Methods

Gate Methods

The Gate type exposes the following members.

Methods
Name Description
Public method AddControl
Creates a new gate by adding one or more control qubits to an existing unitary gate.
Build
Gets the definition of a gate, using the cache. If the gate is already in the cache, the cached definition is returned. Otherwise, a new gate will be created, added to the cache, and returned.
CacheClear
Clears out the gate cache.
CacheStats
Gets gate cache statistics.
Public method Dump
Dumps the full gate information to the consol and/or log.
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method NewMat
Makes a new gate based on this gate but with new unitary matrix.
Public method Run
Run this gate. The details depend on the current value of Ket.Mode:
  • RunMode: Apply this gate operation to the supplied qubits.
  • GateMode: Stores this gate definition into the current Ket. This is for internal use.
  • CircMode: Compiles this gate into a Circuit. This is for internal use.
ShowMem(Int32, FSharpFuncUnit, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.
ShowMem(Int32, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.
Public method ToString
Returns a string representation of this gate, based on the gate's name, help string, and type.
(Overrides ObjectToString.)
Top
See Also

Reference

Gate Class


Gate.AddControl Method

GateAddControl Method
Creates a new gate by adding one or more control qubits to an existing unitary gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member AddControl :
        count : FSharpOption<int> *
        noCache : FSharpOption<bool> -> Gate

Parameters

count
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional number of control qubits to add. The default is a single control.
noCache
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to prevent caching of the new gate. The default is false, which means that the new gate should be cached. The key for the cache is a sequence of capital Cs, one for each control qubit added, followed by an underscore, '_', and then the name of the base gate.

Return Value

Type: Gate
The new controlled gate
See Also

Reference

Gate Class


Gate.Build Method

GateBuild Method
Gets the definition of a gate, using the cache. If the gate is already in the cache, the cached definition is returned. Otherwise, a new gate will be created, added to the cache, and returned.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Build :
        key : string *
        gen : FSharpFunc<Unit, Gate> -> Gate

Parameters

key
Type: SystemString
The uniqur key to use to identify this gate in the cache. This may be more than just the gate name; for instance, for a rotation gate, the cache key must include the rotation angle as well as just "Rz". If the key is null or "", the cache will be bypassed.
gen
Type: Microsoft.FSharp.CoreFSharpFuncUnit, Gate
A function that may be used to create a definition for the gate if it is not already in the cache.

Return Value

Type: Gate
The gate associated with the provided key
See Also

Reference

Gate Class


Gate.CacheClear Method

GateCacheClear Method
Clears out the gate cache.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CacheClear : unit -> unit
See Also

Reference

Gate Class


Gate.CacheStats Method

GateCacheStats Method
Gets gate cache statistics.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CacheStats : unit -> Tuple<int, int>

Return Value

Type: Tuple Int32, Int32
A tuple of the cache hit count and cache miss count.
See Also

Reference

Gate Class


Gate.Dump Method

GateDump Method
Dumps the full gate information to the consol and/or log.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Gate Class


Gate.NewMat Method

GateNewMat Method
Makes a new gate based on this gate but with new unitary matrix.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member NewMat :
        mat : CSMat -> Gate

Parameters

mat
Type: Microsoft.Research.LiquidCSMat
The unitary matrix for the new gate.

Return Value

Type: Gate
The new gate
See Also

Reference

Gate Class


Gate.Run Method

GateRun Method
Run this gate. The details depend on the current value of Ket.Mode:
  • RunMode: Apply this gate operation to the supplied qubits.
  • GateMode: Stores this gate definition into the current Ket. This is for internal use.
  • CircMode: Compiles this gate into a Circuit. This is for internal use.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The Qubits for this gate to operate on. They are also used to identify the current Ket.
See Also

Reference

Gate Class


Gate.ShowMem Method

GateShowMem Method
Overload List
Name | Description
ShowMem(Int32, FSharpFuncUnit, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean) | Outputs memory and garbage collection statistics to the log and console.
ShowMem(Int32, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean) | Outputs memory and garbage collection statistics to the log and console.
Top
See Also

Reference

Gate Class


Gate.ShowMem Method (Int32, FSharpFunc(Unit, String), FSharpOption(FSharpList(Circuit)), FSharpOption(Boolean), FSharpOption(Boolean))

GateShowMem Method (Int32, FSharpFuncUnit, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member ShowMem :
        seconds : int *
        f : FSharpFunc<Unit, string> *
        cs : FSharpOption<FSharpList<Circuit>> *
        deep : FSharpOption<bool> *
        collect : FSharpOption<bool> -> unit

Parameters

seconds
Type: SystemInt32
A minimum interval between reports. If a report was displayed within more recently, then no new report is displayed.
f
Type: Microsoft.FSharp.CoreFSharpFuncUnit, String
A function that returns a string to output as a prefix to the report.
cs
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListCircuit
An optional list of Circuits to analyze. The count of Circuits in the list is reported. If the "deep" parameter is true, then the total count of gates in these Circuits is also reported. The default is an empty list, which displays counts of 0.
deep
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating whether or not to count the gates in the list of Circuits. The default is false, which indicates that the gates should not be counted and will be reported as 0.
collect
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating whether to force a garbage collection. The default is false, to not force a collection.
See Also

Reference

Gate Class
ShowMem Overload


Gate.ShowMem Method (Int32, String, FSharpOption(FSharpList(Circuit)), FSharpOption(Boolean), FSharpOption(Boolean))

GateShowMem Method (Int32, String, FSharpOptionFSharpListCircuit, FSharpOptionBoolean, FSharpOptionBoolean)
Outputs memory and garbage collection statistics to the log and console.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member ShowMem :
        seconds : int *
        str : string *
        cs : FSharpOption<FSharpList<Circuit>> *
        deep : FSharpOption<bool> *
        collect : FSharpOption<bool> -> unit

Parameters

seconds
Type: SystemInt32
A minimum interval between reports. If a report was displayed within more recently, then no new report is displayed.
str
Type: SystemString
A string to output as a prefix to the report.
cs
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListCircuit
An optional list of Circuits to analyze. The count of Circuits in the list is reported. If the "deep" parameter is true, then the total count of gates in these Circuits is also reported. The default is an empty list, which displays counts of 0.
deep
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating whether or not to count the gates in the list of Circuits. The default is false, which indicates that the gates should not be counted and will be reported as 0.
collect
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating whether to force a garbage collection. The default is false, to not force a collection.
See Also

Reference

Gate Class
ShowMem Overload


Gate.ToString Method

GateToString Method
Returns a string representation of this gate, based on the gate's name, help string, and type.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

Gate Class


GateOp Class

GateOp Class
Gate operation type. This is used in Gate definitions.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidGateOp

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type GateOp =  class end

The GateOp type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Creates a string representation of this gate operation type. (Overrides ObjectToString.)
Top
Remarks
The possible values for this type are:
  • Normal: Implements a unitary operation and is defined by a matrix.
  • Measure: Measures a single qubit or the joint parity of a groupt of qubits.
  • Reset(b): Reanimates a measured qubit to the Bit value b. If b is Unknown, then the qubit is reanimated to its last measured value.
  • String: Puts a label in a diagram
  • Modify(n): Modifies a parent gate. The modified gate takes n more wires (input qubits) than the parent gate.
  • BCOp(n,f): Implements a classically-controlled gate. There are two cases: if n is greater than zero, then the control is logically based on the measured values of n qubits. If n is equal to zero, then the control is logically based on the result of one or more joint parity measurements. In either case, f is the function that determines whether or not to execute the parent gate.
  • WrapOp(f): Wraps multiple gates into one logical gate. This is used for multi-level circuit drawing.
  • WrapHam(pqrs,f): Wraps multiple gates into a single Hamiltonian term. This is used for GrowSingle.
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


GateOp Methods

GateOp Methods

The GateOp type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Creates a string representation of this gate operation type. (Overrides ObjectToString.)
Top
See Also

Reference

GateOp Class


GateOp.ToString Method

GateOpToString Method
Creates a string representation of this gate operation type.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string
See Also

Reference

GateOp Class


GrowPars Class

GrowPars Class
Parameters that control circuit growth. See Circuit.Grow, Circuit.GrowGates, and Circuit.GrowSingle.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidGrowPars

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type GrowPars =  class end

The GrowPars type exposes the following members.

Constructors
 | Name | Description
Public method | GrowPars(FSharpOptionInt32, FSharpOptionInt32, FSharpOptionBoolean) | Creates an instance with appropriate parameters for Circuit.GrowGates, which generates a denser circuit equivalent to an existing Circuit.
Public method | GrowPars(Boolean, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionFSharpListInt32, FSharpOptionInt32, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionTupleDouble, Boolean) | Creates an instance with appropriate parameters for Circuit.GrowSingle, which generates a single unitary operation equivalent to an existing Circuit.
Top
Properties
Name Description
Public property AllowDense
If true, allow dense matrices to be generated by Circuit.GrowGates.
Public property Coalesce
For Hamiltonian circuits, a tuple of a scale value and a flag specifying whether or not to keep rotation gates around small angles. The scale value is used if the flag is false. See the Users' Guide for details.
Public property Diff
For Fermion circuits, a list of allowed differences between spin-up and spin-down counts. Effectively, this list constrains the possible values of the total net spin of valid configurations. An empty list, [], means to allow any difference.
Public property ECnt
For Fermion circuits, the valid total electron count (total number of occupied states). A value of 0 means that any number of electrons is valid.
Public property Half
For Fermion circuits, are the qubits ordered so that the first half are the spin-up states? The alternative is for qubits to represent alternating spin-up andn spin-down states.
Public property MaxWires
The maximum wire count for a single grown gate generated by Circuit.GrowGates
Public property OCnt
For Fermion circuits, the number of electron states. In chemical simulations, this is the spin orbital count.
Public property Parity
For Fermion circuits, whether to enforce conservation of angular momentum via parity.
Public property Redund
For Fermion circuits, whether to ignore (set to zero) portions of the resulting unitary that don't satisfy the electron count, parity check, or net spin constraints. See the Users' Guide for details.
Public property Single
If true, build a single unitary; if false, grow gates into a denser circuit.
Public property Skip
Count of initial qubits to skip (because they are used for phase estimation) in Circuit.GrowSingle.
Public property Verbose
The logging verbosity level. Possible values are:
  • 0: No grow logging
  • 1: Final circuit logging
  • 2: Full detailed logging
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of this circuit grow parameter set. (Overrides ObjectToString.)
Public method | VerboseSet | Creates a new GrowPars with a different verbosity setting.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


GrowPars Constructor

GrowPars Constructor
Overload List
 | Name | Description
Public method | GrowPars(FSharpOptionInt32, FSharpOptionInt32, FSharpOptionBoolean) | Creates an instance with appropriate parameters for Circuit.GrowGates, which generates a denser circuit equivalent to an existing Circuit.
Public method | GrowPars(Boolean, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionFSharpListInt32, FSharpOptionInt32, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionTupleDouble, Boolean) | Creates an instance with appropriate parameters for Circuit.GrowSingle, which generates a single unitary operation equivalent to an existing Circuit.
Top
See Also

Reference

GrowPars Class


GrowPars Constructor (FSharpOption(Int32), FSharpOption(Int32), FSharpOption(Boolean))

GrowPars Constructor (FSharpOptionInt32, FSharpOptionInt32, FSharpOptionBoolean)
Creates an instance with appropriate parameters for Circuit.GrowGates, which generates a denser circuit equivalent to an existing Circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        maxWires : FSharpOption<int> *
        verbose : FSharpOption<int> *
        allowDense : FSharpOption<bool> -> GrowPars

Parameters

maxWires
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for MaxWires. The default is 11.
verbose
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for Verbosity. The default is 0.
allowDense
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An optional value for AllowDense. The default is false.
See Also

Reference

GrowPars Class
GrowPars Overload


GrowPars Constructor (Boolean, FSharpOption(Int32), FSharpOption(Int32), FSharpOption(Int32), FSharpOption(FSharpList(Int32)), FSharpOption(Int32), FSharpOption(Boolean), FSharpOption(Boolean), FSharpOption(Tuple(Double, Boolean)))

GrowPars Constructor (Boolean, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionInt32, FSharpOptionFSharpListInt32, FSharpOptionInt32, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionTupleDouble, Boolean)
Creates an instance with appropriate parameters for Circuit.GrowSingle, which generates a single unitary operation equivalent to an existing Circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        half : bool *
        eCnt : FSharpOption<int> *
        oCnt : FSharpOption<int> *
        skip : FSharpOption<int> *
        diff : FSharpOption<FSharpList<int>> *
        verbose : FSharpOption<int> *
        parity : FSharpOption<bool> *
        redund : FSharpOption<bool> *
        coalesce : FSharpOption<Tuple<float, bool>> -> GrowPars

Parameters

half
Type: SystemBoolean
The value for Half. This parameter is required.
eCnt
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for ECnt. The default is 0.
oCnt
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for OCnt. The default is 0.
skip
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for Skip. The default is 0.
diff
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListInt32
An optional value for ECnt. The default is an empty list, [].
verbose
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional value for Verbose. The default is 1.
parity
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An optional value for Parity. The default is false.
redund
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An optional value for Redund. The default is 0.
coalesce
Type: Microsoft.FSharp.CoreFSharpOptionTuple Double, Boolean
An optional value for Coalesce. The default is (0.0, false).
See Also

Reference

GrowPars Class
GrowPars Overload


GrowPars Properties

GrowPars Properties

The GrowPars type exposes the following members.

Properties
Name Description
Public property AllowDense
If true, allow dense matrices to be generated by Circuit.GrowGates.
Public property Coalesce
For Hamiltonian circuits, a tuple of a scale value and a flag specifying whether or not to keep rotation gates around small angles. The scale value is used if the flag is false. See the Users' Guide for details.
Public property Diff
For Fermion circuits, a list of allowed differences between spin-up and spin-down counts. Effectively, this list constrains the possible values of the total net spin of valid configurations. An empty list, [], means to allow any difference.
Public property ECnt
For Fermion circuits, the valid total electron count (total number of occupied states). A value of 0 means that any number of electrons is valid.
Public property Half
For Fermion circuits, are the qubits ordered so that the first half are the spin-up states? The alternative is for qubits to represent alternating spin-up andn spin-down states.
Public property MaxWires
The maximum wire count for a single grown gate generated by Circuit.GrowGates
Public property OCnt
For Fermion circuits, the number of electron states. In chemical simulations, this is the spin orbital count.
Public property Parity
For Fermion circuits, whether to enforce conservation of angular momentum via parity.
Public property Redund
For Fermion circuits, whether to ignore (set to zero) portions of the resulting unitary that don't satisfy the electron count, parity check, or net spin constraints. See the Users' Guide for details.
Public property Single
If true, build a single unitary; if false, grow gates into a denser circuit.
Public property Skip
Count of initial qubits to skip (because they are used for phase estimation) in Circuit.GrowSingle.
Public property Verbose
The logging verbosity level. Possible values are:
  • 0: No grow logging
  • 1: Final circuit logging
  • 2: Full detailed logging
Top
See Also

Reference

GrowPars Class


GrowPars.AllowDense Property

GrowParsAllowDense Property
If true, allow dense matrices to be generated by Circuit.GrowGates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member AllowDense : bool with get

Property Value

Type: Boolean
See Also

Reference

GrowPars Class


GrowPars.Coalesce Property

GrowParsCoalesce Property
For Hamiltonian circuits, a tuple of a scale value and a flag specifying whether or not to keep rotation gates around small angles. The scale value is used if the flag is false. See the Users' Guide for details.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Coalesce : Tuple<float, bool> with get

Property Value

Type: Tuple Double, Boolean
See Also

Reference

GrowPars Class


GrowPars.Diff Property

GrowParsDiff Property
For Fermion circuits, a list of allowed differences between spin-up and spin-down counts. Effectively, this list constrains the possible values of the total net spin of valid configurations. An empty list, [], means to allow any difference.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Diff : FSharpList<int> with get

Property Value

Type: FSharpListInt32
See Also

Reference

GrowPars Class


GrowPars.ECnt Property

GrowParsECnt Property
For Fermion circuits, the valid total electron count (total number of occupied states). A value of 0 means that any number of electrons is valid.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ECnt : int with get

Property Value

Type: Int32
See Also

Reference

GrowPars Class


GrowPars.Half Property

GrowParsHalf Property
For Fermion circuits, are the qubits ordered so that the first half are the spin-up states? The alternative is for qubits to represent alternating spin-up andn spin-down states.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Half : bool with get

Property Value

Type: Boolean
See Also

Reference

GrowPars Class


GrowPars.MaxWires Property

GrowParsMaxWires Property
The maximum wire count for a single grown gate generated by Circuit.GrowGates

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member MaxWires : int with get

Property Value

Type: Int32
See Also

Reference

GrowPars Class


GrowPars.OCnt Property

GrowParsOCnt Property
For Fermion circuits, the number of electron states. In chemical simulations, this is the spin orbital count.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member OCnt : int with get

Property Value

Type: Int32
See Also

Reference

GrowPars Class


GrowPars.Parity Property

GrowParsParity Property
For Fermion circuits, whether to enforce conservation of angular momentum via parity.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Parity : bool with get

Property Value

Type: Boolean
See Also

Reference

GrowPars Class


GrowPars.Redund Property

GrowParsRedund Property
For Fermion circuits, whether to ignore (set to zero) portions of the resulting unitary that don't satisfy the electron count, parity check, or net spin constraints. See the Users' Guide for details.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Redund : bool with get

Property Value

Type: Boolean
See Also

Reference

GrowPars Class


GrowPars.Single Property

GrowParsSingle Property
If true, build a single unitary; if false, grow gates into a denser circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Single : bool with get

Property Value

Type: Boolean
See Also

Reference

GrowPars Class


GrowPars.Skip Property

GrowParsSkip Property
Count of initial qubits to skip (because they are used for phase estimation) in Circuit.GrowSingle.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Skip : int with get

Property Value

Type: Int32
See Also

Reference

GrowPars Class


GrowPars.Verbose Property

GrowParsVerbose Property
The logging verbosity level. Possible values are:
  • 0: No grow logging
  • 1: Final circuit logging
  • 2: Full detailed logging

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Verbose : int with get

Property Value

Type: Int32
See Also

Reference

GrowPars Class


GrowPars Methods

GrowPars Methods

The GrowPars type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of this circuit grow parameter set. (Overrides ObjectToString.)
Public method | VerboseSet | Creates a new GrowPars with a different verbosity setting.
Top
See Also

Reference

GrowPars Class


GrowPars.ToString Method

GrowParsToString Method
Gets a string representation of this circuit grow parameter set.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string
See Also

Reference

GrowPars Class


GrowPars.VerboseSet Method

GrowParsVerboseSet Method
Creates a new GrowPars with a different verbosity setting.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member VerboseSet :
        vNew : int -> GrowPars

Parameters

vNew
Type: SystemInt32
The new verbosity level

Return Value

Type: GrowPars
The new GrowPars instance
See Also

Reference

GrowPars Class


Hamiltonian Class

Hamiltonian Class
Base class for Hamiltonian dynamics simulators.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidHamiltonian
Microsoft.Research.LiquidFermion
Microsoft.Research.LiquidSpin

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Hamiltonian =  class end

The Hamiltonian type exposes the following members.

Constructors
 | Name | Description
Public method | Hamiltonian | Initializes a new instance of the Hamiltonian class
Top
Properties
 | Name | Description
Public property | decohereModel | The decoherence model for this Hamiltonian.
Public property | Ket | Gets the Ket vector associated with this Hamiltonian
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Hamiltonian Constructor

Hamiltonian Constructor
Initializes a new instance of the Hamiltonian class

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new : unit -> Hamiltonian
See Also

Reference

Hamiltonian Class


Hamiltonian Properties

Hamiltonian Properties

The Hamiltonian type exposes the following members.

Properties
 | Name | Description
Public property | decohereModel | The decoherence model for this Hamiltonian.
Public property | Ket | Gets the Ket vector associated with this Hamiltonian
Top
See Also

Reference

Hamiltonian Class


Hamiltonian.decohereModel Property

HamiltoniandecohereModel Property
The decoherence model for this Hamiltonian.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member decohereModel : FSharpList<Tuple<FSharpFunc<Qubit, Unit>, float>> with get, set

Property Value

Type: FSharpListTuple FSharpFuncQubit, Unit, Double
Remarks
A decoherence model is a list of gates and a decoherence probability for each gate. Gates that do not appear have a zero decoherence probability. Note that gates appearing in this list must be fully resolved; they may have no parameters other then the list of qubits.
See Also

Reference

Hamiltonian Class


Hamiltonian.Ket Property

HamiltonianKet Property
Gets the Ket vector associated with this Hamiltonian

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Ket : Ket with get, set

Property Value

Type: Ket
See Also

Reference

Hamiltonian Class


Hamiltonian Methods

Hamiltonian Methods

The Hamiltonian type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Hamiltonian Class


HamiltonianGates Class

HamiltonianGates Class
A collection of gates that are useful for Hamiltonian simulation and annealing.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidHamiltonianGates

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SealedAttribute>]
type HamiltonianGates =  class end

The HamiltonianGates type exposes the following members.

Methods
Name | Description
CGtheta | Performs a controlled global phase rotation.
CRx | Performs a Controlled Pauli X rotation.
CRy | Performs a Controlled Pauli Y rotation.
CRz | Performs a Controlled Pauli Z rotation.
CTtheta | Performs a controlled T rotation.
Entangle | Entangles a list of qubits. This is useful for building Jordan-Wigner strings.
Gtheta | Performs a global phase rotation. This is functionally equivalent to Rpauli (2.0*theta) I qs, but has some additional drawing options.
LoadCache | Preload the cache with the ZZ, Ybasis, and YbasisAdj gates.
Rpauli | Performs an arbitrary rotation based on an existing gate. The base gate may be any unitary gate with a Hermitian, idempotent matrix. Of course, all Pauli gates satisfy this criteria.
Rx | Performs a Pauli X rotation. This is functionally equivalent to Rpauli theta X qs, but has some additional drawing options.
Ry | Performs a Pauli Y rotation. This is functionally equivalent to Rpauli theta Y qs, but has some additional drawing options.
Rz | Performs a Pauli Z rotation. This is functionally equivalent to Rpauli theta Z qs, but has some additional drawing options.
Ttheta | Performs a phase gate rotation. This is functionally equivalent to Rpauli (2.0*theta) T qs, but has some additional drawing options.
UnEntangle | Unentangles a list of qubits. This is useful for building Jordan-Wigner strings.
Ybasis | Performs a basis change from Z to Y.
YbasisAdj | Performs a basis change from Y to Z. This is the adjoint of Ybasis.
ZR | Performs a Pauli Z rotation. This is equivalent to Rpauli (2.0*theta) Z qs.
ZZ | Performs a ZZ gate: Pauli Zs on consectutive wires. This is used for coupling strength.
ZZR | Performs a Pauli ZZ rotation; that is, a simultaneous Z rotation of two qubits. This is equivalent to Rpauli (2.0*theta) ZZ qs.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


HamiltonianGates Methods

HamiltonianGates Methods

The HamiltonianGates type exposes the following members.

Methods
Name | Description
CGtheta | Performs a controlled global phase rotation.
CRx | Performs a Controlled Pauli X rotation.
CRy | Performs a Controlled Pauli Y rotation.
CRz | Performs a Controlled Pauli Z rotation.
CTtheta | Performs a controlled T rotation.
Entangle | Entangles a list of qubits. This is useful for building Jordan-Wigner strings.
Gtheta | Performs a global phase rotation. This is functionally equivalent to Rpauli (2.0*theta) I qs, but has some additional drawing options.
LoadCache | Preload the cache with the ZZ, Ybasis, and YbasisAdj gates.
Rpauli | Performs an arbitrary rotation based on an existing gate. The base gate may be any unitary gate with a Hermitian, idempotent matrix. Of course, all Pauli gates satisfy this criteria.
Rx | Performs a Pauli X rotation. This is functionally equivalent to Rpauli theta X qs, but has some additional drawing options.
Ry | Performs a Pauli Y rotation. This is functionally equivalent to Rpauli theta Y qs, but has some additional drawing options.
Rz | Performs a Pauli Z rotation. This is functionally equivalent to Rpauli theta Z qs, but has some additional drawing options.
Ttheta | Performs a phase gate rotation. This is functionally equivalent to Rpauli (2.0*theta) T qs, but has some additional drawing options.
UnEntangle | Unentangles a list of qubits. This is useful for building Jordan-Wigner strings.
Ybasis | Performs a basis change from Z to Y.
YbasisAdj | Performs a basis change from Y to Z. This is the adjoint of Ybasis.
ZR | Performs a Pauli Z rotation. This is equivalent to Rpauli (2.0*theta) Z qs.
ZZ | Performs a ZZ gate: Pauli Zs on consectutive wires. This is used for coupling strength.
ZZR | Performs a Pauli ZZ rotation; that is, a simultaneous Z rotation of two qubits. This is equivalent to Rpauli (2.0*theta) ZZ qs.
Top
See Also

Reference

HamiltonianGates Class


HamiltonianGates.CGtheta Method

HamiltonianGatesCGtheta Method
Performs a controlled global phase rotation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CGtheta :
        theta : float *
        factor : float *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is the control; the second qubit is the target.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.CRx Method

HamiltonianGatesCRx Method
Performs a Controlled Pauli X rotation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CRx :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is the control; the second qubit is the target.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.CRy Method

HamiltonianGatesCRy Method
Performs a Controlled Pauli Y rotation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CRy :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is the control; the second qubit is the target.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.CRz Method

HamiltonianGatesCRz Method
Performs a Controlled Pauli Z rotation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CRz :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is the control; the second qubit is the target.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.CTtheta Method

HamiltonianGatesCTtheta Method
Performs a controlled T rotation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CTtheta :
        theta : float *
        factor : float *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is the control; the second qubit is the target.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Entangle Method

HamiltonianGatesEntangle Method
Entangles a list of qubits. This is useful for building Jordan-Wigner strings.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Entangle :
        ladder : FSharpList<Tuple<int, int>> *
        qs : FSharpList<Qubit> -> unit

Parameters

ladder
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32
A list of pairs of qubit indices to entangle. Each entry should have a tuple of two indices that refer to qubits in the qs list. The entangle gate will wrap a sequence of CNOT gates, one for each tuple, each with the control being the first qubit in the tuple and the target being the second in the tuple. The CNOT gates are built in ladder list order.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The qubits to build the ladder from.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Gtheta Method

HamiltonianGatesGtheta Method
Performs a global phase rotation. This is functionally equivalent to Rpauli (2.0*theta) I qs, but has some additional drawing options.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Gtheta :
        theta : float *
        factor : float *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.LoadCache Method

HamiltonianGatesLoadCache Method
Preload the cache with the ZZ, Ybasis, and YbasisAdj gates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LoadCache : unit -> unit
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Rpauli Method

HamiltonianGatesRpauli Method
Performs an arbitrary rotation based on an existing gate. The base gate may be any unitary gate with a Hermitian, idempotent matrix. Of course, all Pauli gates satisfy this criteria.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Rpauli :
        theta : float *
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate to base the rotation on.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Rx Method

HamiltonianGatesRx Method
Performs a Pauli X rotation. This is functionally equivalent to Rpauli theta X qs, but has some additional drawing options.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Rx :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Ry Method

HamiltonianGatesRy Method
Performs a Pauli Y rotation. This is functionally equivalent to Rpauli theta Y qs, but has some additional drawing options.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Ry :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Rz Method

HamiltonianGatesRz Method
Performs a Pauli Z rotation. This is functionally equivalent to Rpauli theta Z qs, but has some additional drawing options.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Rz :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 4*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Ttheta Method

HamiltonianGatesTtheta Method
Performs a phase gate rotation. This is functionally equivalent to Rpauli (2.0*theta) T qs, but has some additional drawing options.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Ttheta :
        theta : float *
        factor : float *
        subs : string *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
factor
Type: SystemDouble
A multiplier, used to compute the gate label.
subs
Type: SystemString
A subscript to attach to the gate label. Use an empty string, "", if no subscript is desired.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.UnEntangle Method

HamiltonianGatesUnEntangle Method
Unentangles a list of qubits. This is useful for building Jordan-Wigner strings.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member UnEntangle :
        ladder : FSharpList<Tuple<int, int>> *
        qs : FSharpList<Qubit> -> unit

Parameters

ladder
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Int32
A list of pairs of qubit indices to entangle. Each entry should have a tuple of two indices that refer to qubits in the qs list. The entangle gate will wrap a sequence of CNOT gates, one for each tuple, each with the control being the first qubit in the tuple and the target being the second in the tuple. The CNOT gates are built in the reverse order of the ladder list.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The qubits to build the ladder from.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.Ybasis Method

HamiltonianGatesYbasis Method
Performs a basis change from Z to Y.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Ybasis :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list has its basis changed.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.YbasisAdj Method

HamiltonianGatesYbasisAdj Method
Performs a basis change from Y to Z. This is the adjoint of Ybasis.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member YbasisAdj :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list has its basis changed.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.ZR Method

HamiltonianGatesZR Method
Performs a Pauli Z rotation. This is equivalent to Rpauli (2.0*theta) Z qs.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member ZR :
        theta : float *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit in the list is rotated.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.ZZ Method

HamiltonianGatesZZ Method
Performs a ZZ gate: Pauli Zs on consectutive wires. This is used for coupling strength.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member ZZ :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first two qubits will have Z performed on them.
See Also

Reference

HamiltonianGates Class


HamiltonianGates.ZZR Method

HamiltonianGatesZZR Method
Performs a Pauli ZZ rotation; that is, a simultaneous Z rotation of two qubits. This is equivalent to Rpauli (2.0*theta) ZZ qs.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member ZZR :
        theta : float *
        qs : FSharpList<Qubit> -> unit

Parameters

theta
Type: SystemDouble
The rotation angle. 2*pi is a full rotation.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first two qubits in the list are rotated.
See Also

Reference

HamiltonianGates Class


Ket Class

Ket Class
Represents a state vector.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidKet

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Ket =  class end

The Ket type exposes the following members.

Constructors
 | Name | Description
Public method | Ket | Creates an empty Ket vector.
Public method | Ket(FSharpOptionInt32, FSharpOptionBit) | Creates a populated Ket vector.
Top
Properties
 | Name | Description
Public property | Count | Count of Qubits in state
Public property | Item | Get a specific qubit in our state (by qubit ID)
Public property | MaxEntangled | Max entangled that we've seen (reset during Reset())
Public property | Qubits | Get all qubits in ID order
Public property | RandSeed | Force the pseudo-random number gen to a known initial state
Public property | Rnd | Ask for a random number generator
Public property | Symbol | Symbol table used to store the results of joint parity measurements.
Public property | TraceRun | Trace a circuit run (0=none 1=to log 2=to log and console, 3=Ket dumps)
Top
Methods
 | Name | Description
Public method | Add(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 method | Add(CVec) | Adds a new qubit to the state with a complex state vector. The new qubit is unentangled and has the provided state.
Public method | Add(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 method | Copy | Makes a new Ket that is a deep copy of this Ket.
Public method | Decohere | 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 method | Dump | Dump this state vector.
Public method | DumpKP | 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 method | Entropy | Get the entanglement entropy
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NormDiff | Get L2 Norm of the difference of two ket vectors
Public method | Prob1 | Get the probability of measuring 1 for a single qubit
Public method | ProbOdd | Get the probability of measuring odd parity for a set of qubits
Public method | Probs | Get the state probabilities for a list of qubits (l.e. 10 qubits)
Public method | Purity | Finds the purity of each qubit in this Ket. NOT OPTIMIZED.
 | Read(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.
 | Read(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 method | Reset | Resets this Ket to an initial state with a specified number of qubits.
Public method | Single | Treats this Ket as if all of its qubits are entangled.
Public method | ToString | 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 method | Write(BinaryWriter) | Writes this state vector to a binary stream.
Public method | Write(String) | Writes this state vector to a file.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Ket Constructor

Ket Constructor
Overload List
 | Name | Description
Public method | Ket | Creates an empty Ket vector.
Public method | Ket(FSharpOptionInt32, FSharpOptionBit) | Creates a populated Ket vector.
Top
See Also

Reference

Ket Class


Ket Constructor

Ket Constructor
Creates an empty Ket vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new : unit -> Ket
See Also

Reference

Ket Class
Ket Overload


Ket Constructor (FSharpOption(Int32), FSharpOption(Bit))

Ket Constructor (FSharpOptionInt32, FSharpOptionBit)
Creates a populated Ket vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        count : FSharpOption<int> *
        init : FSharpOption<Bit> -> Ket

Parameters

count
Type: Microsoft.FSharp.CoreFSharpOptionInt32
Number of qubits to allocate.
init
Type: Microsoft.FSharp.CoreFSharpOptionBit
An optional initial value for the qubits, either Zero or One. The default is to initialize all qubits to Zero.
See Also

Reference

Ket Class
Ket Overload


Ket Properties

Ket Properties

The Ket type exposes the following members.

Properties
 | Name | Description
Public property | Count | Count of Qubits in state
Public property | Item | Get a specific qubit in our state (by qubit ID)
Public property | MaxEntangled | Max entangled that we've seen (reset during Reset())
Public property | Qubits | Get all qubits in ID order
Public property | RandSeed | Force the pseudo-random number gen to a known initial state
Public property | Rnd | Ask for a random number generator
Public property | Symbol | Symbol table used to store the results of joint parity measurements.
Public property | TraceRun | Trace a circuit run (0=none 1=to log 2=to log and console, 3=Ket dumps)
Top
See Also

Reference

Ket Class


Ket.Count Property

KetCount Property
Count of Qubits in state

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Count : int with get

Property Value

Type: Int32
See Also

Reference

Ket Class


Ket.Item Property

KetItem Property
Get a specific qubit in our state (by qubit ID)

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Item : Qubit with get

Parameters

i
Type: SystemInt32

Property Value

Type: Qubit
See Also

Reference

Ket Class


Ket.MaxEntangled Property

KetMaxEntangled Property
Max entangled that we've seen (reset during Reset())

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member MaxEntangled : int with get

Property Value

Type: Int32
See Also

Reference

Ket Class


Ket.Qubits Property

KetQubits Property
Get all qubits in ID order

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Qubits : FSharpList<Qubit> with get

Property Value

Type: FSharpListQubit
See Also

Reference

Ket Class


Ket.RandSeed Property

KetRandSeed Property
Force the pseudo-random number gen to a known initial state

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member RandSeed : int with get, set

Property Value

Type: Int32
See Also

Reference

Ket Class


Ket.Rnd Property

KetRnd Property
Ask for a random number generator

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Rnd : Random with get

Property Value

Type: Random
See Also

Reference

Ket Class


Ket.Symbol Property

KetSymbol Property
Symbol table used to store the results of joint parity measurements.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Symbol : int with get, set

Parameters

name
Type: SystemString

Property Value

Type: Int32
See Also

Reference

Ket Class


Ket.TraceRun Property

KetTraceRun Property
Trace a circuit run (0=none 1=to log 2=to log and console, 3=Ket dumps)

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member TraceRun : int with get, set

Property Value

Type: Int32
See Also

Reference

Ket Class


Ket Methods

Ket Methods

The Ket type exposes the following members.

Methods
 | Name | Description
Public method | Add(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 method | Add(CVec) | Adds a new qubit to the state with a complex state vector. The new qubit is unentangled and has the provided state.
Public method | Add(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 method | Copy | Makes a new Ket that is a deep copy of this Ket.
Public method | Decohere | 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 method | Dump | Dump this state vector.
Public method | DumpKP | 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 method | Entropy | Get the entanglement entropy
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NormDiff | Get L2 Norm of the difference of two ket vectors
Public method | Prob1 | Get the probability of measuring 1 for a single qubit
Public method | ProbOdd | Get the probability of measuring odd parity for a set of qubits
Public method | Probs | Get the state probabilities for a list of qubits (l.e. 10 qubits)
Public method | Purity | Finds the purity of each qubit in this Ket. NOT OPTIMIZED.
 | Read(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.
 | Read(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 method | Reset | Resets this Ket to an initial state with a specified number of qubits.
Public method | Single | Treats this Ket as if all of its qubits are entangled.
Public method | ToString | 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 method | Write(BinaryWriter) | Writes this state vector to a binary stream.
Public method | Write(String) | Writes this state vector to a file.
Top
See Also

Reference

Ket Class


Ket.Add Method

KetAdd Method
Overload List
 | Name | Description
Public method | Add(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 method | Add(CVec) | Adds a new qubit to the state with a complex state vector. The new qubit is unentangled and has the provided state.
Public method | Add(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.
Top
See Also

Reference

Ket Class


Ket.Add Method (Bit)

KetAdd Method (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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Add :
        b : Bit -> Qubit

Parameters

b
Type: Microsoft.Research.LiquidBit
The initial state of the added qubit.

Return Value

Type: Qubit
The new Qubit
See Also

Reference

Ket Class
Add Overload


Ket.Add Method (CVec)

KetAdd Method (CVec)
Adds a new qubit to the state with a complex state vector. The new qubit is unentangled and has the provided state.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Add :
        cv : CVec -> Qubit

Parameters

cv
Type: Microsoft.Research.LiquidCVec
The state of the added qubit.

Return Value

Type: Qubit
The new Qubit
See Also

Reference

Ket Class
Add Overload


Ket.Add Method (Int32, Bit)

KetAdd Method (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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Add :
        cnt : int *
        b : Bit -> FSharpList<Qubit>

Parameters

cnt
Type: SystemInt32
The number of qubits to add.
b
Type: Microsoft.Research.LiquidBit
The initial state of the added qubits.

Return Value

Type: FSharpListQubit
The new Qubits
See Also

Reference

Ket Class
Add Overload


Ket.Copy Method

KetCopy Method
Makes a new Ket that is a deep copy of this Ket.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> Ket

Return Value

Type: Ket
The new ket vector
See Also

Reference

Ket Class


Ket.Decohere Method

KetDecohere Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Decohere :
        decohere : FSharpFunc<Qubit, bool> -> FSharpList<int>

Parameters

decohere
Type: Microsoft.FSharp.CoreFSharpFuncQubit, Boolean
The function to apply to each qubit. This function is allowed to modify the state of the qubit.

Return Value

Type: FSharpListInt32
The list of qubits where the function returned true
See Also

Reference

Ket Class


Ket.Dump Method

KetDump Method
Dump this state vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        doMCC : FSharpOption<bool> *
        doSort : FSharpOption<bool> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
doMCC
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option that, if true, causes probabilities (complex magnitude squared) to be output for each state entry, rather than the complex amplitude. The default is to output the complex amplitude for each state.
doSort
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option that, if true, causes the output to be sorted in qubit ID order. The default is to sort the output.
See Also

Reference

Ket Class


Ket.DumpKP Method

KetDumpKP Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DumpKP :
        q : Qubit *
        f : FSharpFunc<int, FSharpFunc<string, Unit>> *
        level : int *
        doMCC : FSharpOption<bool> -> unit

Parameters

q
Type: Microsoft.Research.LiquidQubit
The Qubit that iodentifies the product state factor.
f
Type: Microsoft.FSharp.CoreFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: SystemInt32
The optional indentation level. The default is 0.
doMCC
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option that, if true, causes probabilities (complex magnitude squared) to be output for each state entry, rather than the complex amplitude. The default is to output the complex amplitude for each state.
See Also

Reference

Ket Class


Ket.Entropy Method

KetEntropy Method
Get the entanglement entropy

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Entropy :
        alpha : int *
        qPos : int *
        order : FSharpOption<FSharpList<int>> -> float

Parameters

alpha
Type: SystemInt32
Denotes the generalized entropy parameter: 1 for Von Neumann or 2 for Reny
qPos
Type: SystemInt32
qubit position, 0 to nQubits (based on order)
order
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListInt32
Int list of qubit order to wind up in []=use results of previous call (optional=[0..N-1])

Return Value

Type: Double
Entropy value
See Also

Reference

Ket Class


Ket.NormDiff Method

KetNormDiff Method
Get L2 Norm of the difference of two ket vectors

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member NormDiff :
        v2 : CVec -> float

Parameters

v2
Type: Microsoft.Research.LiquidCVec
Target ket vector to diff (obtained by ket.Single())

Return Value

Type: Double
L2 Norm of the difference
See Also

Reference

Ket Class


Ket.Prob1 Method

KetProb1 Method
Get the probability of measuring 1 for a single qubit

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Prob1 :
        q : Qubit -> float

Parameters

q
Type: Microsoft.Research.LiquidQubit
Qubit to "fake" measure

Return Value

Type: Double
probability
See Also

Reference

Ket Class


Ket.ProbOdd Method

KetProbOdd Method
Get the probability of measuring odd parity for a set of qubits

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ProbOdd :
        qs : FSharpList<Qubit> *
        basis : FSharpOption<string> -> float

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
Qubits to fake measure
basis
Type: Microsoft.FSharp.CoreFSharpOptionString
String of basis to use for each qubit (optional="Z")

Return Value

Type: Double
Probability of odd parity
See Also

Reference

Ket Class


Ket.Probs Method

KetProbs Method
Get the state probabilities for a list of qubits (l.e. 10 qubits)

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Probs :
        qs : FSharpList<Qubit> -> float[]

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
Qubits to fake measure

Return Value

Type: Double
Array of state values (low bit=first qubit requested)
See Also

Reference

Ket Class


Ket.Purity Method

KetPurity Method
Finds the purity of each qubit in this Ket. NOT OPTIMIZED.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Purity : unit -> float[]

Return Value

Type: Double
An array of purities
See Also

Reference

Ket Class


Ket.Read Method

KetRead Method
Overload List
Name | Description
Read(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.
Read(String) | Reads a new state vector from a file. Note that this routine is only intended to read vectors written with the Write method.
Top
See Also

Reference

Ket Class


Ket.Read Method (BinaryReader)

KetRead Method (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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Read :
        br : BinaryReader -> Ket

Parameters

br
Type: System.IOBinaryReader
The stream from which the vector should be read.

Return Value

Type: Ket
The new Ket
See Also

Reference

Ket Class
Read Overload
Microsoft.Research.Liquid Namespace
KetRead(String)


Ket.Read Method (String)

KetRead Method (String)
Reads a new state vector from a file. Note that this routine is only intended to read vectors written with the Write method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Read :
        file : string -> Ket

Parameters

file
Type: SystemString
The name of the file from which the state vector should be read.

Return Value

Type: Ket
The new Ket
See Also

Reference

Ket Class
Read Overload
Microsoft.Research.Liquid Namespace
KetRead(BinaryReader)


Ket.Reset Method

KetReset Method
Resets this Ket to an initial state with a specified number of qubits.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Reset :
        want : FSharpOption<int> *
        init : FSharpOption<Bit> -> FSharpList<Qubit>

Parameters

want
Type: Microsoft.FSharp.CoreFSharpOptionInt32
An optional new qubit count. The default is to keep the same number of qubits.
init
Type: Microsoft.FSharp.CoreFSharpOptionBit
An optional initial value for all qubits. The default is Zero.

Return Value

Type: FSharpListQubit
The new Qubits in this Ket
See Also

Reference

Ket Class


Ket.Single Method

KetSingle Method
Treats this Ket as if all of its qubits are entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Single :
        order : FSharpOption<FSharpList<int>> -> CVec

Parameters

order
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListInt32
Optionally, a list specifying a new order for the qubits. The default is for qubits to remain in their current order.

Return Value

Type: CVec
A CVec that contains the single state vector. Note that it is unsafe to modify this vector.
See Also

Reference

Ket Class


Ket.ToString Method

KetToString Method
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.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

Ket Class


Ket.Write Method

KetWrite Method
Overload List
 | Name | Description
Public method | Write(BinaryWriter) | Writes this state vector to a binary stream.
Public method | Write(String) | Writes this state vector to a file.
Top
See Also

Reference

Ket Class


Ket.Write Method (BinaryWriter)

KetWrite Method (BinaryWriter)
Writes this state vector to a binary stream.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Write :
        bw : BinaryWriter -> unit

Parameters

bw
Type: System.IOBinaryWriter
The stream that this Ket should be written to.
See Also

Reference

Ket Class
Write Overload
Microsoft.Research.Liquid Namespace
KetWrite(String)
KetRead(BinaryReader)


Ket.Write Method (String)

KetWrite Method (String)
Writes this state vector to a file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Write :
        file : string -> unit

Parameters

file
Type: SystemString
The name of the file that this Ket should be written to.
See Also

Reference

Ket Class
Write Overload
Microsoft.Research.Liquid Namespace
Ket.Write(IO, BinaryWriter)
KetRead(String)


Noise Class

Noise Class
A complete noise model for a specific circuit.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidNoise

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Noise =  class end

The Noise type exposes the following members.

Constructors
 | Name | Description
Public method | Noise | Creates a new Noise instance.
Top
Properties
 | Name | Description
Public property | DampProb | The probability of amplitude-damping noise on a qubit. This allows different qubits to have different amplitude damping probabilities.
Public property | DampProbs | (Set only) The amplitude damping probability for all qubits. Use DampProb to get or set the amplitude damping probaility for a single qubit.
Public property | ECgates | The list of wrap gates that are part of error-correcting circuits, by name. A name may end with "*" to indicate a wildcard.
Public property | Idle | (Set only) The idle gate. By default, I (the identity) is the idle gate.
Public property | LogGates | Whether or not to log gate execution to noise statistics during Run(). Gate execution log entires will be marked with detail="!".
Public property | Models | The noise models from last run. This provides access to the detailed statistics.
Public property | NoNoise | The list of noiseless gates, by name. A name may end with "*" to indicate a wildcard.
Public property | Stats | The error statistics from the last run. Statistics are kept in reverse time order.
Public property | TraceNoise | Whether or not to trace noise to the log as it's inserted.
Public property | TraceWrap | Whether or not to trace wrap gates to the log as they're executed.
Top
Methods
 | Name | Description
 | DefaultNoise | Creates a default noise model. The new noise model has depolarizing noise on all qubits, and all gates have unit expected duration.
Public method | Dump | Dumps noise statistics from the last run.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs a circuit with this noise model.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Noise Constructor

Noise Constructor
Creates a new Noise instance.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        circ : Circuit *
        ket : Ket *
        models : FSharpList<NoiseModel> -> Noise

Parameters

circ
Type: Microsoft.Research.LiquidCircuit
The circuit to apply noise to.
ket
Type: Microsoft.Research.LiquidKet
The Ket to use for noise model.
models
Type: Microsoft.FSharp.CollectionsFSharpListNoiseModel
A list of noise models to use, in decreasing precedence order.
See Also

Reference

Noise Class


Noise Properties

Noise Properties

The Noise type exposes the following members.

Properties
 | Name | Description
Public property | DampProb | The probability of amplitude-damping noise on a qubit. This allows different qubits to have different amplitude damping probabilities.
Public property | DampProbs | (Set only) The amplitude damping probability for all qubits. Use DampProb to get or set the amplitude damping probaility for a single qubit.
Public property | ECgates | The list of wrap gates that are part of error-correcting circuits, by name. A name may end with "*" to indicate a wildcard.
Public property | Idle | (Set only) The idle gate. By default, I (the identity) is the idle gate.
Public property | LogGates | Whether or not to log gate execution to noise statistics during Run(). Gate execution log entires will be marked with detail="!".
Public property | Models | The noise models from last run. This provides access to the detailed statistics.
Public property | NoNoise | The list of noiseless gates, by name. A name may end with "*" to indicate a wildcard.
Public property | Stats | The error statistics from the last run. Statistics are kept in reverse time order.
Public property | TraceNoise | Whether or not to trace noise to the log as it's inserted.
Public property | TraceWrap | Whether or not to trace wrap gates to the log as they're executed.
Top
See Also

Reference

Noise Class


Noise.DampProb Property

NoiseDampProb Property
The probability of amplitude-damping noise on a qubit. This allows different qubits to have different amplitude damping probabilities.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DampProb : float with get, set

Parameters

id
Type: SystemInt32
The ID of the qubit

Property Value

Type: Double
See Also

Reference

Noise Class


Noise.DampProbs Property

NoiseDampProbs Property
(Set only) The amplitude damping probability for all qubits. Use DampProb to get or set the amplitude damping probaility for a single qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member DampProbs : float with set

Property Value

Type: Double
See Also

Reference

Noise Class


Noise.ECgates Property

NoiseECgates Property
The list of wrap gates that are part of error-correcting circuits, by name. A name may end with "*" to indicate a wildcard.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ECgates : FSharpList<string> with get, set

Property Value

Type: FSharpListString
See Also

Reference

Noise Class


Noise.Idle Property

NoiseIdle Property
(Set only) The idle gate. By default, I (the identity) is the idle gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Idle : Gate with set

Property Value

Type: Gate
See Also

Reference

Noise Class


Noise.LogGates Property

NoiseLogGates Property
Whether or not to log gate execution to noise statistics during Run(). Gate execution log entires will be marked with detail="!".

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member LogGates : bool with get, set

Property Value

Type: Boolean
See Also

Reference

Noise Class


Noise.Models Property

NoiseModels Property
The noise models from last run. This provides access to the detailed statistics.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Models : FSharpList<NoiseModel> with get

Property Value

Type: FSharpListNoiseModel
See Also

Reference

Noise Class


Noise.NoNoise Property

NoiseNoNoise Property
The list of noiseless gates, by name. A name may end with "*" to indicate a wildcard.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member NoNoise : FSharpList<string> with get, set

Property Value

Type: FSharpListString
See Also

Reference

Noise Class


Noise.Stats Property

NoiseStats Property
The error statistics from the last run. Statistics are kept in reverse time order.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Stats : FSharpList<NoiseStat> with get

Property Value

Type: FSharpListNoiseStat
See Also

Reference

Noise Class


Noise.TraceNoise Property

NoiseTraceNoise Property
Whether or not to trace noise to the log as it's inserted.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member TraceNoise : bool with get, set

Property Value

Type: Boolean
See Also

Reference

Noise Class


Noise.TraceWrap Property

NoiseTraceWrap Property
Whether or not to trace wrap gates to the log as they're executed.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member TraceWrap : bool with get, set

Property Value

Type: Boolean
See Also

Reference

Noise Class


Noise Methods

Noise Methods

The Noise type exposes the following members.

Methods
 | Name | Description
 | DefaultNoise | Creates a default noise model. The new noise model has depolarizing noise on all qubits, and all gates have unit expected duration.
Public method | Dump | Dumps noise statistics from the last run.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs a circuit with this noise model.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Noise Class


Noise.DefaultNoise Method

NoiseDefaultNoise Method
Creates a default noise model. The new noise model has depolarizing noise on all qubits, and all gates have unit expected duration.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member DefaultNoise :
        prob : float -> NoiseModel

Parameters

prob
Type: SystemDouble
The probability of depolarizing noise occuring per unit of time.

Return Value

Type: NoiseModel
The new noise model.
See Also

Reference

Noise Class


Noise.Dump Method

NoiseDump Method
Dumps noise statistics from the last run.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> *
        doStats : FSharpOption<bool> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
doStats
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to dump full statistics. The default is false, in which case summary statistics per gate pattern are displayed.
See Also

Reference

Noise Class


Noise.Run Method

NoiseRun Method
Runs a circuit with this noise model.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        ket2 : FSharpOption<Ket> -> unit

Parameters

ket2
Type: Microsoft.FSharp.CoreFSharpOptionKet
An optional state vector to use to re-initialize execution. If provided, this Ket is used for the run and all times and statistics are reset. If not provided, then execution continues from the state after the last Run.
See Also

Reference

Noise Class


NoiseEvents Class

NoiseEvents Class
Noise statistics that are tracked for normal and error-correcting gates.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidNoiseEvents

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type NoiseEvents =
    class
        interface IEquatable<NoiseEvents>
        interface IStructuralEquatable
        interface IComparable<NoiseEvents>
        interface IComparable
        interface IStructuralComparable
    end

The NoiseEvents type exposes the following members.

Properties
 | Name | Description
Public property | applied | The number of times noise has been applied
Public property | count | The number of times the model has been executed
Public property | events | The number of noise events
Top
Methods
 | Name | Description
Public method | Accum | Increments this instance with counts from another instance.
 | Default | Creates a new instance with all counts initialized to 0.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Reset | Resets all counters back to 0.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


NoiseEvents Properties

NoiseEvents Properties

The NoiseEvents type exposes the following members.

Properties
 | Name | Description
Public property | applied | The number of times noise has been applied
Public property | count | The number of times the model has been executed
Public property | events | The number of noise events
Top
See Also

Reference

NoiseEvents Class


NoiseEvents.applied Property

NoiseEventsapplied Property
The number of times noise has been applied

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member applied : int with get, set

Property Value

Type: Int32
See Also

Reference

NoiseEvents Class


NoiseEvents.count Property

NoiseEventscount Property
The number of times the model has been executed

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member count : int with get, set

Property Value

Type: Int32
See Also

Reference

NoiseEvents Class


NoiseEvents.events Property

NoiseEventsevents Property
The number of noise events

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member events : int with get, set

Property Value

Type: Int32
See Also

Reference

NoiseEvents Class


NoiseEvents Methods

NoiseEvents Methods

The NoiseEvents type exposes the following members.

Methods
 | Name | Description
Public method | Accum | Increments this instance with counts from another instance.
 | Default | Creates a new instance with all counts initialized to 0.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Reset | Resets all counters back to 0.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

NoiseEvents Class


NoiseEvents.Accum Method

NoiseEventsAccum Method
Increments this instance with counts from another instance.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Accum :
        y : NoiseEvents -> unit

Parameters

y
Type: Microsoft.Research.LiquidNoiseEvents
The instance containing counts to add to this instance's counts.
See Also

Reference

NoiseEvents Class


NoiseEvents.Default Method

NoiseEventsDefault Method
Creates a new instance with all counts initialized to 0.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Default : unit -> NoiseEvents

Return Value

Type: NoiseEvents
The new instance.
See Also

Reference

NoiseEvents Class


NoiseEvents.Reset Method

NoiseEventsReset Method
Resets all counters back to 0.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Reset : unit -> unit
See Also

Reference

NoiseEvents Class


NoiseModel Class

NoiseModel Class
A noise model for a particular type of gate (or set of gates).
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidNoiseModel

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type NoiseModel =  class end

The NoiseModel type exposes the following members.

Properties
 | Name | Description
Public property | ecEvents | Accumulated noise statistics for error-correcting gates.
Public property | func | The noise function to execute.
Public property | gate | The name of the gate that this noise model applies to. The name may end with an asterisk, '*', to indicate a wildcard match.
Public property | gateEvents | Accumulated noise statistics for normal gates.
Public property | maxQs | The maximum number of qubits to apply noise to.
Public property | time | The expected duration of the gate. By convention, an idle gate takes 1.0 units.
Top
Methods
 | Name | Description
 | Default | Creates a default noise model that will apply to all gates.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


NoiseModel Properties

NoiseModel Properties

The NoiseModel type exposes the following members.

Properties
 | Name | Description
Public property | ecEvents | Accumulated noise statistics for error-correcting gates.
Public property | func | The noise function to execute.
Public property | gate | The name of the gate that this noise model applies to. The name may end with an asterisk, '*', to indicate a wildcard match.
Public property | gateEvents | Accumulated noise statistics for normal gates.
Public property | maxQs | The maximum number of qubits to apply noise to.
Public property | time | The expected duration of the gate. By convention, an idle gate takes 1.0 units.
Top
See Also

Reference

NoiseModel Class


NoiseModel.ecEvents Property

NoiseModelecEvents Property
Accumulated noise statistics for error-correcting gates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ecEvents : NoiseEvents with get

Property Value

Type: NoiseEvents
See Also

Reference

NoiseModel Class


NoiseModel.func Property

NoiseModelfunc Property
The noise function to execute.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member func : FSharpFunc<float, FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, FSharpList<Tuple<FSharpList<Qubit>, FSharpOption<string>>>>>> with get

Property Value

Type: FSharpFuncDouble, FSharpFuncDouble, FSharpFuncFSharpListQubit , FSharpListTuple FSharpListQubit , FSharpOptionString
See Also

Reference

NoiseModel Class


NoiseModel.gate Property

NoiseModelgate Property
The name of the gate that this noise model applies to. The name may end with an asterisk, '*', to indicate a wildcard match.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member gate : string with get

Property Value

Type: String
See Also

Reference

NoiseModel Class


NoiseModel.gateEvents Property

NoiseModelgateEvents Property
Accumulated noise statistics for normal gates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member gateEvents : NoiseEvents with get

Property Value

Type: NoiseEvents
See Also

Reference

NoiseModel Class


NoiseModel.maxQs Property

NoiseModelmaxQs Property
The maximum number of qubits to apply noise to.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member maxQs : int with get

Property Value

Type: Int32
See Also

Reference

NoiseModel Class


NoiseModel.time Property

NoiseModeltime Property
The expected duration of the gate. By convention, an idle gate takes 1.0 units.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member time : float with get

Property Value

Type: Double
See Also

Reference

NoiseModel Class


NoiseModel Methods

NoiseModel Methods

The NoiseModel type exposes the following members.

Methods
 | Name | Description
 | Default | Creates a default noise model that will apply to all gates.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

NoiseModel Class


NoiseModel.Default Method

NoiseModelDefault Method
Creates a default noise model that will apply to all gates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Default :
        modelFunc : FSharpFunc<float, FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, FSharpList<Tuple<FSharpList<Qubit>, FSharpOption<string>>>>>> -> NoiseModel

Parameters

modelFunc
Type: Microsoft.FSharp.CoreFSharpFuncDouble, FSharpFuncDouble, FSharpFuncFSharpListQubit , FSharpListTuple FSharpListQubit , FSharpOptionString
The noise function to apply.

Return Value

Type: NoiseModel
A noise model that will apply the given function to all gates, to a single qubit, and initialized with zero statistics.
See Also

Reference

NoiseModel Class


NoiseStat Class

NoiseStat Class
Statistics tracked for each time that noise is applied.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidNoiseStat

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type NoiseStat =  class end

The NoiseStat type exposes the following members.

Properties
 | Name | Description
Public property | detail | User-defined noise details from the noise function output.
Public property | dur | The duration of the noise applicationm.
Public property | ecGate | Whether or not thie was flagged as an error correcting gate.
Public property | model | The noise model that was applied.
Public property | qs | The qubits that noise was applied to.
Public property | time | When noise was applied during the simulated execution.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of this noise statistic. (Overrides ObjectToString.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


NoiseStat Properties

NoiseStat Properties

The NoiseStat type exposes the following members.

Properties
 | Name | Description
Public property | detail | User-defined noise details from the noise function output.
Public property | dur | The duration of the noise applicationm.
Public property | ecGate | Whether or not thie was flagged as an error correcting gate.
Public property | model | The noise model that was applied.
Public property | qs | The qubits that noise was applied to.
Public property | time | When noise was applied during the simulated execution.
Top
See Also

Reference

NoiseStat Class


NoiseStat.detail Property

NoiseStatdetail Property
User-defined noise details from the noise function output.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member detail : string with get

Property Value

Type: String
See Also

Reference

NoiseStat Class


NoiseStat.dur Property

NoiseStatdur Property
The duration of the noise applicationm.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member dur : float with get

Property Value

Type: Double
See Also

Reference

NoiseStat Class


NoiseStat.ecGate Property

NoiseStatecGate Property
Whether or not thie was flagged as an error correcting gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ecGate : bool with get

Property Value

Type: Boolean
See Also

Reference

NoiseStat Class


NoiseStat.model Property

NoiseStatmodel Property
The noise model that was applied.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member model : NoiseModel with get

Property Value

Type: NoiseModel
See Also

Reference

NoiseStat Class


NoiseStat.qs Property

NoiseStatqs Property
The qubits that noise was applied to.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member qs : FSharpList<Qubit> with get

Property Value

Type: FSharpListQubit
See Also

Reference

NoiseStat Class


NoiseStat.time Property

NoiseStattime Property
When noise was applied during the simulated execution.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member time : float with get

Property Value

Type: Double
See Also

Reference

NoiseStat Class


NoiseStat Methods

NoiseStat Methods

The NoiseStat type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of this noise statistic. (Overrides ObjectToString.)
Top
See Also

Reference

NoiseStat Class


NoiseStat.ToString Method

NoiseStatToString Method
Returns a string representation of this noise statistic.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string
See Also

Reference

NoiseStat Class


NoisyMats Class

NoisyMats Class
Utility class for computing a Pauli rotation matrix. This is used to run quantum chemistry circuits with noise injected.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidNoisyMats

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type NoisyMats =  class end

The NoisyMats type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
 | GenRot | Generates a Pauli-based rotation matrix for an arbitrary angle.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


NoisyMats Methods

NoisyMats Methods

The NoisyMats type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
 | GenRot | Generates a Pauli-based rotation matrix for an arbitrary angle.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

NoisyMats Class


NoisyMats.GenRot Method

NoisyMatsGenRot Method
Generates a Pauli-based rotation matrix for an arbitrary angle.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member GenRot :
        theta : float *
        mParent : CSMat -> CSMat

Parameters

theta
Type: SystemDouble
The rotation angle.
mParent
Type: Microsoft.Research.LiquidCSMat
The base matrix for the rotation. This must be an idempotent Hermitian matrix.

Return Value

Type: CSMat
A rotation matrix, exp(i*theta/2*mParent).
See Also

Reference

NoisyMats Class


Operations Class

Operations Class
The Operations module provides definitions of basic gates. It also includes some handy operators for manipulating qubit lists, and some operations for building gates from existing gates.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidOperations

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SealedAttribute>]
type Operations =  class end

The Operations type exposes the following members.

Methods
Name | Description
Adj | Performs the adjoint of the parent gate. This only works if the parent gate is a unitary gate.
BC | Performs a gate under classical control. The parent gate will be executed if the control qubit has a measured value of One.
BCany | Performs a gate under classical control. This gate allows an arbitrary condition to be specified. The parent gate will be executed if the condition function evaluates to true.
CCgate | Performs a parent gate under two-qubit quantum control. The parent must be a unitary gate.
CCNOT | Performs a Toffoli or Controlled-Controlled-NOT gate
Cgate | Performs a parent gate under quantum control. The parent must be a unitary gate.
CgateNC | Performs a parent gate under quantum control. The parent must be a unitary gate. The resulting gate is not cached.
CNOT | Performs a quantum-controlled NOT gate
CZ | Performs a quantum-controlled Pauli Z gate.
H | Performs a Hadamard gate.
I | Performs a Pauli I (identify) gate.
JM | Performs a joint parity measurement in the given basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
JMx | Performs a joint parity measurement in the X basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
JMz | Performs a joint parity measurement in the computational basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
Label | Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LabelC | Adds a label to a circuit drawing. The label be centered in and will fill the current cell.
LabelCD | Adds a framed label to a circuit drawing. The label be centered in and will fill the current cell. The label will have a box drawn tightly around it.
LabelD | Adds a label to a circuit drawing. The label will appear below the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LabelL | Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the left side of the current column. The label will take up no logical space; it will not fill the current cell.
LabelR | Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the right side of the current column. The label will take up no logical space; it will not fill the current cell.
LabelRaw | Adds a raw label to a circuit drawing. The provided string should contain the Q-Circuit commands used to draw the label. Note that labels drawn using this gate will only appear when rendered to "qc" format.
LabelU | Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LoadCache | Preload the cache with basic gates: Paulis, measurement, Hadamard, phase, CNOT, Toffoli, swap, and T.
M | Performs a measurement of a single qubit in the computational basis. The result of the measurement is stored in the measured qubit; see Qubit.Bit. The state vector is collapsed according to the result of the measurement. The measured qubit becomes "classical" and must be reset before any further quantum gates are performed on it.
Native | Performs any desired native operations at this point in the circuit.
NativeDbg | Performs any desired native operations at this point in the circuit. This version doesn't appear in a circuit drawing.
PC | Performs a gate based on a classical condition. The parent gate is executed if the test function returns true. Typically this condition is based on the results of one or more joint parity measurements.
R | Performs a 2pi/2^K rotation gate gate.
Reset | Resets a qubit to a specified initial state after it has been measured. This allows quantum gates to be performed against the collapsed qubit. See the M gate.
Restore | Resets a qubit after it has been measured. This allows quantum gates to be performed against the collapsed qubit. The initial state of the qubit will be its last measured state. See the M gate.
S | Performs a phase gate.
SWAP | Performs a swap gate, exchanging the quantum states of two qubits.
T | Performs a pi/8 gate.
T_BC | Performs a transverse classically-controlled gate.
Transverse | Expands a parent gate to a transverse version.
X | Performs a Pauli X gate.
Y | Performs a Pauli Y gate.
Z | Performs a Pauli Z gate.
Top
Operators
Name | Description
BangBang | In F# code, this operator is named !!. Builds a list of Qubits from a wide variety of possible inputs.
BangLess | In F# code, this operator is named !<. Gets the gate definition from a gate function. This is usually used to discover the "parent" gate.
GreaterBangLessa | In F# code, this operator is named >!<. Applies a function to each qubit in a list, passing a parameter to the function as well as each Qubit. The parameter values may be a list of a single value which is then passed to each invocation.
GreaterLess | In F# code, this operator is named ><. Applies a function to each qubit in a list of Qubits.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Operations Methods

Operations Methods

The Operations type exposes the following members.

Methods
Name | Description
Adj | Performs the adjoint of the parent gate. This only works if the parent gate is a unitary gate.
BC | Performs a gate under classical control. The parent gate will be executed if the control qubit has a measured value of One.
BCany | Performs a gate under classical control. This gate allows an arbitrary condition to be specified. The parent gate will be executed if the condition function evaluates to true.
CCgate | Performs a parent gate under two-qubit quantum control. The parent must be a unitary gate.
CCNOT | Performs a Toffoli or Controlled-Controlled-NOT gate
Cgate | Performs a parent gate under quantum control. The parent must be a unitary gate.
CgateNC | Performs a parent gate under quantum control. The parent must be a unitary gate. The resulting gate is not cached.
CNOT | Performs a quantum-controlled NOT gate
CZ | Performs a quantum-controlled Pauli Z gate.
H | Performs a Hadamard gate.
I | Performs a Pauli I (identify) gate.
JM | Performs a joint parity measurement in the given basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
JMx | Performs a joint parity measurement in the X basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
JMz | Performs a joint parity measurement in the computational basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.
Label | Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LabelC | Adds a label to a circuit drawing. The label be centered in and will fill the current cell.
LabelCD | Adds a framed label to a circuit drawing. The label be centered in and will fill the current cell. The label will have a box drawn tightly around it.
LabelD | Adds a label to a circuit drawing. The label will appear below the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LabelL | Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the left side of the current column. The label will take up no logical space; it will not fill the current cell.
LabelR | Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the right side of the current column. The label will take up no logical space; it will not fill the current cell.
LabelRaw | Adds a raw label to a circuit drawing. The provided string should contain the Q-Circuit commands used to draw the label. Note that labels drawn using this gate will only appear when rendered to "qc" format.
LabelU | Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.
LoadCache | Preload the cache with basic gates: Paulis, measurement, Hadamard, phase, CNOT, Toffoli, swap, and T.
M | Performs a measurement of a single qubit in the computational basis. The result of the measurement is stored in the measured qubit; see Qubit.Bit. The state vector is collapsed according to the result of the measurement. The measured qubit becomes "classical" and must be reset before any further quantum gates are performed on it.
Native | Performs any desired native operations at this point in the circuit.
NativeDbg | Performs any desired native operations at this point in the circuit. This version doesn't appear in a circuit drawing.
PC | Performs a gate based on a classical condition. The parent gate is executed if the test function returns true. Typically this condition is based on the results of one or more joint parity measurements.
R | Performs a 2pi/2^K rotation gate gate.
Reset | Resets a qubit to a specified initial state after it has been measured. This allows quantum gates to be performed against the collapsed qubit. See the M gate.
Restore | Resets a qubit after it has been measured. This allows quantum gates to be performed against the collapsed qubit. The initial state of the qubit will be its last measured state. See the M gate.
S | Performs a phase gate.
SWAP | Performs a swap gate, exchanging the quantum states of two qubits.
T | Performs a pi/8 gate.
T_BC | Performs a transverse classically-controlled gate.
Transverse | Expands a parent gate to a transverse version.
X | Performs a Pauli X gate.
Y | Performs a Pauli Y gate.
Z | Performs a Pauli Z gate.
Top
See Also

Reference

Operations Class


Operations.Adj Method

OperationsAdj Method
Performs the adjoint of the parent gate. This only works if the parent gate is a unitary gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Adj :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate to take the adjoint of
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits which are passed to the adjoint.
See Also

Reference

Operations Class


Operations.BC Method

OperationsBC Method
Performs a gate under classical control. The parent gate will be executed if the control qubit has a measured value of One.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member BC :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The parent gate to control
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits. The head qubit is the control qubit; its measured state determines whether or not the parent gate is executed. The tail of the list is passed to the parent gate if it is executed.
See Also

Reference

Operations Class


Operations.BCany Method

OperationsBCany Method
Performs a gate under classical control. This gate allows an arbitrary condition to be specified. The parent gate will be executed if the condition function evaluates to true.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member BCany :
        cnt : int *
        tst : FSharpFunc<FSharpList<Qubit>, bool> *
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

cnt
Type: SystemInt32
The count of binary control bits. These bits will not be passed to the parent gate.
tst
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Boolean
The condition function that controls execution of the parent gate.
f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The parent gate to control
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits. The initial cnt qubits are provided to the condition function, and the remainder are passed to the parent gate if it is executed.
See Also

Reference

Operations Class
Microsoft.Research.Liquid Namespace
OperationsBC(FSharpFuncFSharpListQubit, Unit, FSharpListQubit)


Operations.CCgate Method

OperationsCCgate Method
Performs a parent gate under two-qubit quantum control. The parent must be a unitary gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CCgate :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate to control.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first two qubits are the control, and the remainder are passed to the parent gate.
See Also

Reference

Operations Class


Operations.CCNOT Method

OperationsCCNOT Method
Performs a Toffoli or Controlled-Controlled-NOT gate

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CCNOT :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first two qubits in the list are the control qubits, and the third qubit is the target,
See Also

Reference

Operations Class


Operations.Cgate Method

OperationsCgate Method
Performs a parent gate under quantum control. The parent must be a unitary gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Cgate :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate to control.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit is the control qubit, and the remainder are passed to the parent gate.
See Also

Reference

Operations Class


Operations.CgateNC Method

OperationsCgateNC Method
Performs a parent gate under quantum control. The parent must be a unitary gate. The resulting gate is not cached.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CgateNC :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate to control.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first qubit is the control qubit, and the remainder are passed to the parent gate.
See Also

Reference

Operations Class


Operations.CNOT Method

OperationsCNOT Method
Performs a quantum-controlled NOT gate

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CNOT :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit is the control qubit, the second qubit is the target.
See Also

Reference

Operations Class


Operations.CZ Method

OperationsCZ Method
Performs a quantum-controlled Pauli Z gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member CZ :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit is the control qubit, the second qubit is the target.
See Also

Reference

Operations Class


Operations.H Method

OperationsH Method
Performs a Hadamard gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member H :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.I Method

OperationsI Method
Performs a Pauli I (identify) gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member I :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.JM Method

OperationsJM Method
Performs a joint parity measurement in the given basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member JM :
        tag : string *
        basis : string *
        qs : FSharpList<Qubit> -> unit

Parameters

tag
Type: SystemString
If not empty, the symbol name to store the measurement result under. See Ket.Symbol.
basis
Type: SystemString
The basis to measure in. This may be a string of any length, including empty, made up of X, Y, and Z characters. Each character is used to specify the basis for the corresponding qubit being measured. If there are more qubits than bases specified, then the last basis character is repeated. If this is an empty string, then it is treated as "Z", which performs a joint measurement of all qubits in the computational basis.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to jointly measure.
See Also

Reference

Operations Class


Operations.JMx Method

OperationsJMx Method
Performs a joint parity measurement in the X basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member JMx :
        tag : string *
        qs : FSharpList<Qubit> -> unit

Parameters

tag
Type: SystemString
If not empty, the symbol name to store the measurement result under. See Ket.Symbol.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to jointly measure.
See Also

Reference

Operations Class


Operations.JMz Method

OperationsJMz Method
Performs a joint parity measurement in the computational basis on a list of qubits. The result of the measurement is stored in the Ket's symbol table. The state vector is collapsed according to the result of the measurement.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member JMz :
        tag : string *
        qs : FSharpList<Qubit> -> unit

Parameters

tag
Type: SystemString
If not empty, the symbol name to store the measurement result under. See Ket.Symbol.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to jointly measure.
See Also

Reference

Operations Class


Operations.Label Method

OperationsLabel Method
Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Label :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelC Method

OperationsLabelC Method
Adds a label to a circuit drawing. The label be centered in and will fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelC :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelCD Method

OperationsLabelCD Method
Adds a framed label to a circuit drawing. The label be centered in and will fill the current cell. The label will have a box drawn tightly around it.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelCD :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelD Method

OperationsLabelD Method
Adds a label to a circuit drawing. The label will appear below the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelD :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelL Method

OperationsLabelL Method
Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the left side of the current column. The label will take up no logical space; it will not fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelL :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelR Method

OperationsLabelR Method
Adds a label to a circuit drawing. The label will appear centered on the line representing the qubit, on the right side of the current column. The label will take up no logical space; it will not fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelR :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelRaw Method

OperationsLabelRaw Method
Adds a raw label to a circuit drawing. The provided string should contain the Q-Circuit commands used to draw the label. Note that labels drawn using this gate will only appear when rendered to "qc" format.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelRaw :
        cmd : string *
        qs : FSharpList<Qubit> -> unit

Parameters

cmd
Type: SystemString
The string to use to draw the label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LabelU Method

OperationsLabelU Method
Adds a label to a circuit drawing. The label will appear above the line representing the qubit, in the center of the current column. The label will take up no logical space; it will not fill the current cell.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LabelU :
        nam : string *
        qs : FSharpList<Qubit> -> unit

Parameters

nam
Type: SystemString
The string to use as a label.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits, the first of which determines the vertical positioning of the label.
See Also

Reference

Operations Class


Operations.LoadCache Method

OperationsLoadCache Method
Preload the cache with basic gates: Paulis, measurement, Hadamard, phase, CNOT, Toffoli, swap, and T.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member LoadCache : unit -> unit
See Also

Reference

Operations Class


Operations.M Method

OperationsM Method
Performs a measurement of a single qubit in the computational basis. The result of the measurement is stored in the measured qubit; see Qubit.Bit. The state vector is collapsed according to the result of the measurement. The measured qubit becomes "classical" and must be reset before any further quantum gates are performed on it.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member M :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits; the head of the list is measured.
See Also

Reference

Operations Class


Operations.Native Method

OperationsNative Method
Performs any desired native operations at this point in the circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Native :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The native function to call.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to pass to the native operation.
See Also

Reference

Operations Class
Microsoft.Research.Liquid Namespace
OperationsNativeDbg(FSharpFuncFSharpListQubit, Unit, FSharpListQubit)


Operations.NativeDbg Method

OperationsNativeDbg Method
Performs any desired native operations at this point in the circuit. This version doesn't appear in a circuit drawing.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member NativeDbg :
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The native function to call.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to pass to the native operation.
See Also

Reference

Operations Class
Microsoft.Research.Liquid Namespace
OperationsNative(FSharpFuncFSharpListQubit, Unit, FSharpListQubit)


Operations.PC Method

OperationsPC Method
Performs a gate based on a classical condition. The parent gate is executed if the test function returns true. Typically this condition is based on the results of one or more joint parity measurements.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member PC :
        lbl : string *
        tst : FSharpFunc<FSharpList<Qubit>, bool> *
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

lbl
Type: SystemString
A label for drawing.
tst
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Boolean
The test function used to control execution of the parent gate.
f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The parent gate to control
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits which will be passed to the parent gate if it is executed.
See Also

Reference

Operations Class
Microsoft.Research.Liquid Namespace
Ket.Symbol(String, Int32)


Operations.R Method

OperationsR Method
Performs a 2pi/2^K rotation gate gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member R :
        k : int *
        qs : FSharpList<Qubit> -> unit

Parameters

k
Type: SystemInt32
The rotation parameter
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.Reset Method

OperationsReset Method
Resets a qubit to a specified initial state after it has been measured. This allows quantum gates to be performed against the collapsed qubit. See the M gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Reset :
        b : Bit *
        qs : FSharpList<Qubit> -> unit

Parameters

b
Type: Microsoft.Research.LiquidBit
The initial state of the reset qubit, either Zero or One.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits; the head of the list is reset.
See Also

Reference

Operations Class


Operations.Restore Method

OperationsRestore Method
Resets a qubit after it has been measured. This allows quantum gates to be performed against the collapsed qubit. The initial state of the qubit will be its last measured state. See the M gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Restore :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of qubits; the head of the list is reset.
See Also

Reference

Operations Class


Operations.S Method

OperationsS Method
Performs a phase gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member S :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.SWAP Method

OperationsSWAP Method
Performs a swap gate, exchanging the quantum states of two qubits.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member SWAP :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The states of the first two qubits in the list are swapped.
See Also

Reference

Operations Class


Operations.T Method

OperationsT Method
Performs a pi/8 gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member T :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.T_BC Method

OperationsT_BC Method
Performs a transverse classically-controlled gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member T_BC :
        decode : FSharpFunc<FSharpList<Qubit>, Tuple<Bit, int>> *
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

decode
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Tuple Bit, Int32
The code-specific decode function that takes a list of measured qubits and returns a logical value (One or Zero) and the Hamming distance from the current state to a valid code state.
f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The (transverse) parent gate to control
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The first codeSize qubits in the list are passed to the decode function to compute a logical Zero or One state. If the decoded state is One, then the remaining qubits are passed to the parent gate.
See Also

Reference

Operations Class


Operations.Transverse Method

OperationsTransverse Method
Expands a parent gate to a transverse version.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Transverse :
        cCnt : int *
        f : FSharpFunc<FSharpList<Qubit>, Unit> *
        qs : FSharpList<Qubit> -> unit

Parameters

cCnt
Type: SystemInt32
The total number of qubits in code
f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The parent gate to expand
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The qubits that final gate will operate on
Remarks
If the parent gate operates on a single qubit, then it is applied to each qubit in the code. If the parent gate applies to two qubits, then it is applied to pairs of qubits selected from the first and second half of the list. For example, if the code contained 3 qubits, so that the qubits to operate on would contain 6 qubits, then the gate would be applied to pairs 0 and 3, 1 and 4, and 2 and 5.

It is an error if the parent gate takes more than two qubits.

The transverse gate's name is the parent's name with a "_T" suffix.

See Also

Reference

Operations Class


Operations.X Method

OperationsX Method
Performs a Pauli X gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member X :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.Y Method

OperationsY Method
Performs a Pauli Y gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Y :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations.Z Method

OperationsZ Method
Performs a Pauli Z gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Z :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The head qubit of this list is operated on.
See Also

Reference

Operations Class


Operations Operators

Operations Operators

The Operations type exposes the following members.

Operators
Name | Description
BangBang | In F# code, this operator is named !!. Builds a list of Qubits from a wide variety of possible inputs.
BangLess | In F# code, this operator is named !<. Gets the gate definition from a gate function. This is usually used to discover the "parent" gate.
GreaterBangLessa | In F# code, this operator is named >!<. Applies a function to each qubit in a list, passing a parameter to the function as well as each Qubit. The parameter values may be a list of a single value which is then passed to each invocation.
GreaterLess | In F# code, this operator is named ><. Applies a function to each qubit in a list of Qubits.
Top
See Also

Reference

Operations Class


Operations.BangBang Operator

OperationsBangBang Operator
In F# code, this operator is named !!. Builds a list of Qubits from a wide variety of possible inputs.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

qs
Type: SystemObject
The value to interpret as a list of Qubits.

Return Value

Type: FSharpListQubit
A list of Qubits
Remarks
The inputs that are interprested by this operator are:
  • A Ket, which is interpreted as the complete list of Qubits in the Ket.
  • A single Qubit, which is interpreted as a single-element list.
  • A two-tuple of Qubits, which is interpreted as a two-element list.
  • A three-tuple of Qubits, which is interpreted as a three-element list.
  • A list of Qubits, which is returned directly.
  • A two-tuple of lists of Qubits, which are concatenated into a single list.
  • A three-tuple of lists of Qubits, which are concatenated into a single list.
  • A list of lists of Qubits, which are concatenated into a single list.
  • A two-tuple of a list of Qubits and a single Qubit, which are concatenated into a single list.
  • A two-tuple of a single Qubit and a list of Qubits, which are concatenated into a single list.
  • A two-tuple of a list of Qubits and an integer, which is interpreted as the single-element list containing the item in the list indexed by the integer.
  • A three-tuple of a list of Qubits and two integers, which is interpreted as the two-element list containing the items in the list indexed by the two integers.
  • A four-tuple of a list of Qubits and three integers, which is interpreted as the three-element list containing the item in the list indexed by the three integers.
  • A two-tuple of a list of Qubits and a list of integers, which is interpreted as the list containing the items in the Qubit list indexed by the elements in the integer list.
See Also

Reference

Operations Class


Operations.BangLess Operator

OperationsBangLess Operator
In F# code, this operator is named !<. Gets the gate definition from a gate function. This is usually used to discover the "parent" gate.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate function we want the Gate for.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
A list of Qubits that can be used to find the gate.

Return Value

Type: Gate
The Gate corresponding to the gate function. Note that if f is not a gate function, this function will raise an exception.
See Also

Reference

Operations Class


Operations.GreaterBangLess(a) Operator

OperationsGreaterBangLessa Operator
In F# code, this operator is named >!<. Applies a function to each qubit in a list, passing a parameter to the function as well as each Qubit. The parameter values may be a list of a single value which is then passed to each invocation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFunca, FSharpFuncFSharpListQubit , Unit
The function to call. The extra parameter must be the first argument to the function.
args
Type: SystemObject
Either a list of arguments, one per Qubit, or a single value that is passed with each Qubit.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to iterate over.

Type Parameters

a
See Also

Reference

Operations Class


Operations.GreaterLess Operator

OperationsGreaterLess Operator
In F# code, this operator is named ><. Applies a function to each qubit in a list of Qubits.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
F# does not support this operator.

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncFSharpListQubit , Unit
The gate function to call.
qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The list of qubits to iterate over.
See Also

Reference

Operations Class


QECC Class

QECC Class
Base class for quantum error correcting codes.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidQECC
Microsoft.Research.LiquidSteane7

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SerializableAttribute>]
type QECC =  class end

The QECC type exposes the following members.

Constructors
 | Name | Description
Public method | QECC | Initializes a Quantum Error Correcting Circuit (QECC). This base constructor must be called by all derived constructors.
Top
Properties
 | Name | Description
Public property | Circuit | The error-correcting circuit built by Compile. The circuit will be built now if it hasn't already been.
Public property | Ket | The state vector for the compiled code.
Top
Methods
 | Name | Description
Public method | Compile | Compiles the target circuit into an error-correcting version.
Public method | Decode | Decodes a set of measured physical qubits to get the measured value for a logical qubit.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetMeasured | Gets the measured values of the physical qubits that make up a logical qubit and returns them combined into a single integer, one bit per qubit.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Inject | Injects dephasing errors with the given probability into the error-correcting circuit.
Public method | Log2Phys | Gets the physical qubits that make up a logical qubit.
Public method | Prep | A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method.
Public method | Replace | Gets a replacement physical gate for an input logical gate. The replacement may wrap a full Circuit.
Public method | Syndrome | A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


QECC Constructor

QECC Constructor
Initializes a Quantum Error Correcting Circuit (QECC). This base constructor must be called by all derived constructors.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        aCnt : int *
        cCnt : int *
        tgt : Circuit -> QECC

Parameters

aCnt
Type: SystemInt32
The number of ancilla qubits. By convention ancillae come first in the state vector, before data and syndrome qubits. Ancilla qubits are shared across all logical qubits and are for use during decoding, measurement, and other operations; they are not syndrome qubits.
cCnt
Type: SystemInt32
The code size; that is, the number of physical qubits (data and syndrome) per logical qubit.
tgt
Type: Microsoft.Research.LiquidCircuit
The target Circuit to build an error-correcting circuit for.
See Also

Reference

QECC Class


QECC Properties

QECC Properties

The QECC type exposes the following members.

Properties
 | Name | Description
Public property | Circuit | The error-correcting circuit built by Compile. The circuit will be built now if it hasn't already been.
Public property | Ket | The state vector for the compiled code.
Top
See Also

Reference

QECC Class


QECC.Circuit Property

QECCCircuit Property
The error-correcting circuit built by Compile. The circuit will be built now if it hasn't already been.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Circuit : Circuit with get

Property Value

Type: Circuit
See Also

Reference

QECC Class


QECC.Ket Property

QECCKet Property
The state vector for the compiled code.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Ket : Ket with get

Property Value

Type: Ket
See Also

Reference

QECC Class


QECC Methods

QECC Methods

The QECC type exposes the following members.

Methods
 | Name | Description
Public method | Compile | Compiles the target circuit into an error-correcting version.
Public method | Decode | Decodes a set of measured physical qubits to get the measured value for a logical qubit.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetMeasured | Gets the measured values of the physical qubits that make up a logical qubit and returns them combined into a single integer, one bit per qubit.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Inject | Injects dephasing errors with the given probability into the error-correcting circuit.
Public method | Log2Phys | Gets the physical qubits that make up a logical qubit.
Public method | Prep | A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method.
Public method | Replace | Gets a replacement physical gate for an input logical gate. The replacement may wrap a full Circuit.
Public method | Syndrome | A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

QECC Class


QECC.Compile Method

QECCCompile Method
Compiles the target circuit into an error-correcting version.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Compile : unit -> unit
See Also

Reference

QECC Class


QECC.Decode Method

QECCDecode Method
Decodes a set of measured physical qubits to get the measured value for a logical qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Decode :
        qs : FSharpList<Qubit> -> Tuple<Bit, int>

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The physical qubits to decode. They must already have been measured.

Return Value

Type: Tuple Bit, Int32
A tuple containing the logical measured value of the logical qubit, either Zero or One, and the Hamming distance from the physical state to the code space.
See Also

Reference

QECC Class


QECC.GetMeasured Method

QECCGetMeasured Method
Gets the measured values of the physical qubits that make up a logical qubit and returns them combined into a single integer, one bit per qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member GetMeasured :
        qs : FSharpList<Qubit> -> int

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The set of qubits to read. This should be the set of physical (data and syndrome) qubits for one logical qubit.

Return Value

Type: Int32
The total measured value of the qubits. The value of the first qubit in the list goes into the left-most (most significant) bit in the result.
See Also

Reference

QECC Class


QECC.Inject Method

QECCInject Method
Injects dephasing errors with the given probability into the error-correcting circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Inject :
        prob : float -> Tuple<Circuit, FSharpList<int>>

Parameters

prob
Type: SystemDouble
The probability of an error on execution of a gate. Each qubit input to the gate has this same chance of a dephasing error. If an error is injected, it will be either an X, Y, or Z error, with equal probability. Note that errors are never injected on ancilla qubits.

Return Value

Type: Tuple Circuit, FSharpListInt32
A tuple containing the new Circuit with errors injected as the first item and a list of injected error counts as the second. The error count list contains the count of X, Y, and Z errors injected, in that order.
Remarks
Note that the errors are inserted as explicit gates into a new Circuit, rather than randomly being injected on each run. That is, if the resulting circuit is executed multiple times, the same errors will be injected each time. To get a different set of random errors, this routine must be re-run and a new Circuit generated.

Also note that errors are only inserted before wrapped and extended gates (Gate types Wrap and Ext). In particular, this means that errors appear before logical gates rather than before physical gates. If the original non-error correcting circuit included wrapped or extended gates, then errors may be injected before those gates as well.

See Also

Reference

QECC Class


QECC.Log2Phys Method

QECCLog2Phys Method
Gets the physical qubits that make up a logical qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Log2Phys :
        w : int -> FSharpList<Qubit>

Parameters

w
Type: SystemInt32
The wire ID of the logical qubit in the original non-error correcting circuit.

Return Value

Type: FSharpListQubit
A list of the physical qubits that implement the logical qubit.
See Also

Reference

QECC Class


QECC.Prep Method

QECCPrep Method
A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Prep :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The physical qubits for the logical qubit. This contains both data and syndrome qubits, but no ancillae.
See Also

Reference

QECC Class


QECC.Replace Method

QECCReplace Method
Gets a replacement physical gate for an input logical gate. The replacement may wrap a full Circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Replace :
        g : Gate -> FSharpOption<FSharpFunc<FSharpList<Qubit>, Unit>>
override Replace :
        g : Gate -> FSharpOption<FSharpFunc<FSharpList<Qubit>, Unit>>

Parameters

g
Type: Microsoft.Research.LiquidGate
The logical gate function to replace.

Return Value

Type: FSharpOptionFSharpFuncFSharpListQubit , Unit
An option holding a physical gate that implements the logical gate. If there is no physical implementation of the logical gate, then None is returned.
Remarks
The default implementation replaces the Pauli gates, phase gate, Hadamard gate, identity gate, CNOT, and measurement with transverse versions of these gates. Classically-controlled versions of these gates are replaced by transverse versions, controlled by the decoded (logical) value of the classical control.
See Also

Reference

QECC Class


QECC.Syndrome Method

QECCSyndrome Method
A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Syndrome :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The ancilla qubits followed by physical qubits for the logical qubit. The number of ancillae was passed to the QECC constructor.
See Also

Reference

QECC Class


Qubit Class

Qubit Class
Represents a quantum bit. New Qubits are created using the Ket Add methods.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidQubit

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Qubit =  class end

The Qubit type exposes the following members.

Properties
 | Name | Description
Public property | Bit | The measured value of a qubit in the computational basis. This will be Unknown if the qubit has not been measured since it last interacted.
Public property | Entangled | Whether or not this qubit is entangled.
Public property | Id | Wire number in Ket vector
Public property | Ket | State we belong to
 | One | A Complex vector that represents the state |1> in the computational basis.
Public property | Prob1 | The probability of this qubit being 1.
Public property | State | The state vector for this qubit, if it is unentangled. This property will raise an exception if the qubit is entangled.
Public property | Type | The type of the qubit. This is only used for noise modeling.
 | Zero | A Complex vector that represents the state |0> in the computational basis.
Top
Methods
 | Name | Description
Public method | Dump | Dump this qubit's state.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReAnimate(Bit) | Reanimates this qubit and sets its state vector to |0> or |1>. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Public method | ReAnimate(CVec) | Reanimates this qubit and sets its state vector. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Public method | ShowMag | Creates a string representation of this Qubit. The representation shows the probabilities of measuring this Qubit in the computational |0> and |1> states.
Public method | StateSet(Bit) | Sets the state vector for this qubit to |0> or |1>, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(CVec) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Complex, Complex) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Double, Double, Double, Double) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | ToString | Creates a string representation of this Qubit. The representation shows the current state of the qubit if it is unentangled. (Overrides ObjectToString.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Qubit Properties

Qubit Properties

The Qubit type exposes the following members.

Properties
 | Name | Description
Public property | Bit | The measured value of a qubit in the computational basis. This will be Unknown if the qubit has not been measured since it last interacted.
Public property | Entangled | Whether or not this qubit is entangled.
Public property | Id | Wire number in Ket vector
Public property | Ket | State we belong to
 | One | A Complex vector that represents the state |1> in the computational basis.
Public property | Prob1 | The probability of this qubit being 1.
Public property | State | The state vector for this qubit, if it is unentangled. This property will raise an exception if the qubit is entangled.
Public property | Type | The type of the qubit. This is only used for noise modeling.
 | Zero | A Complex vector that represents the state |0> in the computational basis.
Top
See Also

Reference

Qubit Class


Qubit.Bit Property

QubitBit Property
The measured value of a qubit in the computational basis. This will be Unknown if the qubit has not been measured since it last interacted.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Bit : Bit with get, set

Property Value

Type: Bit
See Also

Reference

Qubit Class


Qubit.Entangled Property

QubitEntangled Property
Whether or not this qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Entangled : bool with get

Property Value

Type: Boolean
See Also

Reference

Qubit Class


Qubit.Id Property

QubitId Property
Wire number in Ket vector

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Id : int with get

Property Value

Type: Int32
See Also

Reference

Qubit Class


Qubit.Ket Property

QubitKet Property
State we belong to

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Ket : Ket with get

Property Value

Type: Ket
See Also

Reference

Qubit Class


Qubit.One Property

QubitOne Property
A Complex vector that represents the state |1> in the computational basis.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member One : CVec with get

Property Value

Type: CVec
See Also

Reference

Qubit Class


Qubit.Prob1 Property

QubitProb1 Property
The probability of this qubit being 1.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Prob1 : float with get

Property Value

Type: Double
See Also

Reference

Qubit Class


Qubit.State Property

QubitState Property
The state vector for this qubit, if it is unentangled. This property will raise an exception if the qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member State : CVec with get

Property Value

Type: CVec
See Also

Reference

Qubit Class


Qubit.Type Property

QubitType Property
The type of the qubit. This is only used for noise modeling.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Type : string with get, set

Property Value

Type: String
See Also

Reference

Qubit Class


Qubit.Zero Property

QubitZero Property
A Complex vector that represents the state |0> in the computational basis.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Zero : CVec with get

Property Value

Type: CVec
See Also

Reference

Qubit Class


Qubit Methods

Qubit Methods

The Qubit type exposes the following members.

Methods
 | Name | Description
Public method | Dump | Dump this qubit's state.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReAnimate(Bit) | Reanimates this qubit and sets its state vector to |0> or |1>. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Public method | ReAnimate(CVec) | Reanimates this qubit and sets its state vector. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Public method | ShowMag | Creates a string representation of this Qubit. The representation shows the probabilities of measuring this Qubit in the computational |0> and |1> states.
Public method | StateSet(Bit) | Sets the state vector for this qubit to |0> or |1>, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(CVec) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Complex, Complex) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Double, Double, Double, Double) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | ToString | Creates a string representation of this Qubit. The representation shows the current state of the qubit if it is unentangled. (Overrides ObjectToString.)
Top
See Also

Reference

Qubit Class


Qubit.Dump Method

QubitDump Method
Dump this qubit's state.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Dump :
        f : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        level : FSharpOption<int> -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
level
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
See Also

Reference

Qubit Class


Qubit.ReAnimate Method

QubitReAnimate Method
Overload List
 | Name | Description
Public method | ReAnimate(Bit) | Reanimates this qubit and sets its state vector to |0> or |1>. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Public method | ReAnimate(CVec) | Reanimates this qubit and sets its state vector. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.
Top
See Also

Reference

Qubit Class


Qubit.ReAnimate Method (Bit)

QubitReAnimate Method (Bit)
Reanimates this qubit and sets its state vector to |0> or |1>. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ReAnimate :
        b : Bit -> unit

Parameters

b
Type: Microsoft.Research.LiquidBit
The Bit value to set this qubit's state to.
See Also

Reference

Qubit Class
ReAnimate Overload


Qubit.ReAnimate Method (CVec)

QubitReAnimate Method (CVec)
Reanimates this qubit and sets its state vector. Reanimation means that this qubit is treated as unmeasured and eligible for quantum operations. This method will raise an exception if the qubit is unmeasured or entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ReAnimate :
        v : CVec -> unit

Parameters

v
Type: Microsoft.Research.LiquidCVec
The Complex vector to set this qubit's state to.
See Also

Reference

Qubit Class
ReAnimate Overload


Qubit.ShowMag Method

QubitShowMag Method
Creates a string representation of this Qubit. The representation shows the probabilities of measuring this Qubit in the computational |0> and |1> states.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ShowMag : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

Qubit Class
Microsoft.Research.Liquid Namespace
[M:Microsoft.Research.Liquid.Qubit.ToString()]


Qubit.StateSet Method

QubitStateSet Method
Overload List
 | Name | Description
Public method | StateSet(Bit) | Sets the state vector for this qubit to |0> or |1>, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(CVec) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Complex, Complex) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Public method | StateSet(Double, Double, Double, Double) | Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.
Top
See Also

Reference

Qubit Class


Qubit.StateSet Method (Bit)

QubitStateSet Method (Bit)
Sets the state vector for this qubit to |0> or |1>, if it is unentangled. This method will raise an exception if the qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member StateSet :
        b : Bit -> unit

Parameters

b
Type: Microsoft.Research.LiquidBit
The Bit value to set this qubit's state to.
See Also

Reference

Qubit Class
StateSet Overload


Qubit.StateSet Method (CVec)

QubitStateSet Method (CVec)
Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member StateSet :
        v : CVec -> unit

Parameters

v
Type: Microsoft.Research.LiquidCVec
The Complex vector to set this qubit's state to.
See Also

Reference

Qubit Class
StateSet Overload


Qubit.StateSet Method (Complex, Complex)

QubitStateSet Method (Complex, Complex)
Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member StateSet :
        c1 : Complex *
        c2 : Complex -> unit

Parameters

c1
Type: Microsoft.Research.LiquidComplex
The complex |0> amplitude to set this qubit's state to.
c2
Type: Microsoft.Research.LiquidComplex
The complex |1> amplitude to set this qubit's state to.
See Also

Reference

Qubit Class
StateSet Overload


Qubit.StateSet Method (Double, Double, Double, Double)

QubitStateSet Method (Double, Double, Double, Double)
Sets the state vector for this qubit, if it is unentangled. This method will raise an exception if the qubit is entangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member StateSet :
        r1 : float *
        i1 : float *
        r2 : float *
        i2 : float -> unit

Parameters

r1
Type: SystemDouble
The real part of the |0> amplitude to set this qubit's state to.
i1
Type: SystemDouble
The imaginary part of the |0> amplitude to set this qubit's state to.
r2
Type: SystemDouble
The real part of the |1> amplitude to set this qubit's state to.
i2
Type: SystemDouble
The imaginary part of the |1> amplitude to set this qubit's state to.
See Also

Reference

Qubit Class
StateSet Overload


Qubit.ToString Method

QubitToString Method
Creates a string representation of this Qubit. The representation shows the current state of the qubit if it is unentangled.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
The string representation
See Also

Reference

Qubit Class
Microsoft.Research.Liquid Namespace
[M:Microsoft.Research.Liquid.Qubit.ShowMag()]


RunMode Class

RunMode Class
Trotterization types.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidRunMode

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type RunMode =
    class
        interface IEquatable<RunMode>
        interface IStructuralEquatable
        interface IComparable<RunMode>
        interface IComparable
        interface IStructuralComparable
    end

The RunMode type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Remarks
Possible values are:
  • Trotter1: First order Trotter
  • Trotter1X: First order Trotter splitting X to each side
  • Trotter1R: Reverse mode (implies reversing list and negating angles)
  • Trotter1XR: Reverse mode with X splitting (implies reversing list and negating angles)
  • Trotter2: Second order Trotter (includes X splitting)
  • Trotter2R: Second order reversed (includes X splitting)
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


RunMode Methods

RunMode Methods

The RunMode type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

RunMode Class


Spin Class

Spin Class
Hamiltonian for spin systems, such as the Ising model or a spin glass.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidHamiltonian
Microsoft.Research.LiquidSpin

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Spin =
    class
        inherit Hamiltonian
    end

The Spin type exposes the following members.

Constructors
 | Name | Description
Public method | Spin(DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double) | Creates a spin Hamiltonian for simple systems that only have single spin biases and two-spin couplings. The count of spins is inferred.
Public method | Spin(FSharpListSpinTerm, Int32, FSharpOptionRunMode) | Creates a spin Hamiltonian from a set of spin terms.
Top
Properties
 | Name | Description
Public property | currentCirc | The last (grown) circuit that was run.
Public property | decohereModel | The decoherence model for this Hamiltonian. (Inherited from Hamiltonian.)
Public property | Ket | Gets the Ket vector associated with this Hamiltonian (Inherited from Hamiltonian.)
Public property | lastAnneal | The last set of annealing coefficients that were applied.
Public property | lastRawCirc | The last (ungrown) circuit that was run.
Public property | runMode | The run mode. Note that setting this property will force a new circuit to be generated.
Public property | time | The current simulation time. Note that setting this property will force a new circuit to be generated.
Public property | trotterN | The Trotter number. Note that setting this property will force a new circuit to be generated.
Top
Methods
 | Name | Description
Public method | Copy | Returns an instance of Spin with the same Hamiltonian parameters as this instance. Simulation parameters such as run time and Trotter number are not copied.
Public method | EnergyExpectation | Finds the expectation value of the Hamiltonian. That is, given a state vector |psi>, this method computes <psi|H|psi>.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
 | Ferro | Test adiabatic evolution with a ferro-magnetic chain
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Peek | Peeks at the current Hamiltonian matrix. This is based on the most recently grown circuit.
Public method | Prep | Prepares the qubit state for a run. All qubits are resets and initialized to the ground state.
Public method | Run | Runs the simulation. This is a highly optimized implementation.
Public method | Step | Performs a single timestep of simulation.
 | Test(String, Int32, Int32, FSharpListTupleInt32, Double, Int32, Spin, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
 | Test(String, Int32, Int32, DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double, FSharpListTupleInt32, Double, Double, Int32, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Spin Constructor

Spin Constructor
Overload List
 | Name | Description
Public method | Spin(DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double) | Creates a spin Hamiltonian for simple systems that only have single spin biases and two-spin couplings. The count of spins is inferred.
Public method | Spin(FSharpListSpinTerm, Int32, FSharpOptionRunMode) | Creates a spin Hamiltonian from a set of spin terms.
Top
See Also

Reference

Spin Class


Spin Constructor (Dictionary(Int32, Double), Dictionary(Tuple(Int32, Int32), Double))

Spin Constructor (DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double)
Creates a spin Hamiltonian for simple systems that only have single spin biases and two-spin couplings. The count of spins is inferred.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        hs : Dictionary<int, float> *
        Js : Dictionary<Tuple<int, int>, float> -> Spin

Parameters

hs
Type: System.Collections.GenericDictionary Int32, Double
A Dictionary that maps a qubit id to that qubit's bias strength (Z term coefficient).
Js
Type: System.Collections.GenericDictionary Tuple Int32, Int32 , Double
A Dictionary that maps a pair of qubit id's to the pair's coupling strength (ZZ coefficient).
See Also

Reference

Spin Class
Spin Overload


Spin Constructor (FSharpList(SpinTerm), Int32, FSharpOption(RunMode))

Spin Constructor (FSharpListSpinTerm, Int32, FSharpOptionRunMode)
Creates a spin Hamiltonian from a set of spin terms.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        _spinTerms : FSharpList<SpinTerm> *
        _numSpins : int *
        _runMode : FSharpOption<RunMode> -> Spin

Parameters

_spinTerms
Type: Microsoft.FSharp.CollectionsFSharpListSpinTerm
The list of SpinTerms that together make up the spin Hamiltonian.
_numSpins
Type: SystemInt32
The number of spins in the system.
_runMode
Type: Microsoft.FSharp.CoreFSharpOptionRunMode
The Trotterization type to use. This must be one of Trotter1, Trotter1X, or Trotter2.
See Also

Reference

Spin Class
Spin Overload


Spin Properties

Spin Properties

The Spin type exposes the following members.

Properties
 | Name | Description
Public property | currentCirc | The last (grown) circuit that was run.
Public property | decohereModel | The decoherence model for this Hamiltonian. (Inherited from Hamiltonian.)
Public property | Ket | Gets the Ket vector associated with this Hamiltonian (Inherited from Hamiltonian.)
Public property | lastAnneal | The last set of annealing coefficients that were applied.
Public property | lastRawCirc | The last (ungrown) circuit that was run.
Public property | runMode | The run mode. Note that setting this property will force a new circuit to be generated.
Public property | time | The current simulation time. Note that setting this property will force a new circuit to be generated.
Public property | trotterN | The Trotter number. Note that setting this property will force a new circuit to be generated.
Top
See Also

Reference

Spin Class


Spin.currentCirc Property

SpincurrentCirc Property
The last (grown) circuit that was run.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member currentCirc : Circuit with get

Property Value

Type: Circuit
See Also

Reference

Spin Class


Spin.lastAnneal Property

SpinlastAnneal Property
The last set of annealing coefficients that were applied.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member lastAnneal : float[] with get

Property Value

Type: Double
See Also

Reference

Spin Class


Spin.lastRawCirc Property

SpinlastRawCirc Property
The last (ungrown) circuit that was run.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member lastRawCirc : Circuit with get

Property Value

Type: Circuit
See Also

Reference

Spin Class


Spin.runMode Property

SpinrunMode Property
The run mode. Note that setting this property will force a new circuit to be generated.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member runMode : RunMode with get, set

Property Value

Type: RunMode
Remarks
Possibilities are Trotter1 (fully first-order); Trotter1X (does X/2 on both sides, but fully first-order in other terms); and Trotter2 (fully second-order). The initial default value for new Hamiltonians is Trotter1.
See Also

Reference

Spin Class


Spin.time Property

Spintime Property
The current simulation time. Note that setting this property will force a new circuit to be generated.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member time : int with get, set

Property Value

Type: Int32
See Also

Reference

Spin Class


Spin.trotterN Property

SpintrotterN Property
The Trotter number. Note that setting this property will force a new circuit to be generated.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member trotterN : int with get, set

Property Value

Type: Int32
See Also

Reference

Spin Class


Spin Methods

Spin Methods

The Spin type exposes the following members.

Methods
 | Name | Description
Public method | Copy | Returns an instance of Spin with the same Hamiltonian parameters as this instance. Simulation parameters such as run time and Trotter number are not copied.
Public method | EnergyExpectation | Finds the expectation value of the Hamiltonian. That is, given a state vector |psi>, this method computes <psi|H|psi>.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
 | Ferro | Test adiabatic evolution with a ferro-magnetic chain
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Peek | Peeks at the current Hamiltonian matrix. This is based on the most recently grown circuit.
Public method | Prep | Prepares the qubit state for a run. All qubits are resets and initialized to the ground state.
Public method | Run | Runs the simulation. This is a highly optimized implementation.
Public method | Step | Performs a single timestep of simulation.
 | Test(String, Int32, Int32, FSharpListTupleInt32, Double, Int32, Spin, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
 | Test(String, Int32, Int32, DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double, FSharpListTupleInt32, Double, Double, Int32, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Spin Class


Spin.Copy Method

SpinCopy Method
Returns an instance of Spin with the same Hamiltonian parameters as this instance. Simulation parameters such as run time and Trotter number are not copied.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Copy : unit -> Spin

Return Value

Type: Spin
Copy of this instance
See Also

Reference

Spin Class


Spin.EnergyExpectation Method

SpinEnergyExpectation Method
Finds the expectation value of the Hamiltonian. That is, given a state vector |psi>, this method computes <psi|H|psi>.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member EnergyExpectation :
        stdev : bool *
        anneal : FSharpOption<float[]> *
        qubits : FSharpOption<FSharpList<Qubit>> -> Tuple<float, float>

Parameters

stdev
Type: SystemBoolean
Whether or not to evaluate the standard deviation as well.
anneal
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional array of annealing values to use. The default is to use the most recent annealing values.
qubits
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListQubit
An optional state vector to take the expectation value against. The default is to use this.Ket.Qubits; that is, the qubits from the current Ket vector.

Return Value

Type: Tuple Double, Double
A tuple of the expectation value and standard deviation. The standard deviation will be 0.0 if it was not computed.
See Also

Reference

Spin Class


Spin.Ferro Method

SpinFerro Method
Test adiabatic evolution with a ferro-magnetic chain

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Ferro :
        repeat : int *
        sCnt : int *
        h0 : float *
        hn : float *
        J : float *
        gammalambda : FSharpOption<FSharpList<Tuple<int, float, float>>> *
        runonce : FSharpOption<bool> *
        decohereModel : FSharpOption<FSharpList<Tuple<FSharpFunc<Qubit, Unit>, float>>> -> unit

Parameters

repeat
Type: SystemInt32
How many tests to run
sCnt
Type: SystemInt32
How many qubits
h0
Type: SystemDouble
-1,0,1 = left most down, random, up
hn
Type: SystemDouble
-1,0,1 = right most down, random, up
J
Type: SystemDouble
coupling: 1=ferro -1=anti 0=none
gammalambda
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListTuple Int32, Double, Double
List of (time,gamma,lambda) tuples that define the annealing schedule (optional=[(30,0.0,1.0)])
runonce
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
true=run the simulation once and perform repeated 'virtual measurements'; false=run the simulation and measure each time (optional=false)
decohereModel
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListTuple FSharpFuncQubit, Unit, Double
Decoherence probability per qubit per timestep [(gate,prob) list] optional=None
See Also

Reference

Spin Class


Spin.Peek Method

SpinPeek Method
Peeks at the current Hamiltonian matrix. This is based on the most recently grown circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Peek :
        anneal : FSharpOption<float[]> -> CSMat

Parameters

anneal
Type: Microsoft.FSharp.CoreFSharpOptionDouble
An optional array of annealing values to use. The default is to use the most recent annealing values.

Return Value

Type: CSMat
A sparse matrix representation of the Hamiltonian
See Also

Reference

Spin Class


Spin.Prep Method

SpinPrep Method
Prepares the qubit state for a run. All qubits are resets and initialized to the ground state.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Prep : unit -> unit
See Also

Reference

Spin Class


Spin.Run Method

SpinRun Method
Runs the simulation. This is a highly optimized implementation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        dt : int *
        schedule : FSharpList<Tuple<int, float[]>> *
        gp : FSharpOption<GrowPars> -> int

Parameters

dt
Type: SystemInt32
The number of timesteps to run.
schedule
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Double
The annealing schedule to use. Each entry in the list is a tuple whose first entry is a time step and whose second entry is an array of annealing values. Annealing values for time steps in between entries are computed by linearly interpolating between those for the previous and next entries. The list must be in ascneding order by time step.
gp
Type: Microsoft.FSharp.CoreFSharpOptionGrowPars
Optional grow parameters for the resulting circuit. The default is GrowGates with maxWires of 11. See GrowPars for more details.

Return Value

Type: Int32
The number of decoherence events which occured during the step. Note that this will be zero unless a decoherence model has been set on this instance.
See Also

Reference

Spin Class


Spin.Step Method

SpinStep Method
Performs a single timestep of simulation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Step :
        angles : float[] *
        gp : FSharpOption<GrowPars> -> int

Parameters

angles
Type: SystemDouble
The vector of annealing coefficients to be used in this step.
gp
Type: Microsoft.FSharp.CoreFSharpOptionGrowPars
Optional grow parameters for the resulting circuit. The default is GrowGates with maxWires of 11. See GrowPars for more details.

Return Value

Type: Int32
The number of decoherence events which occured during the step. Note that this will be zero unless a decoherence model has been set on this instance.
See Also

Reference

Spin Class


Spin.Test Method

SpinTest Method
Overload List
Name | Description
Test(String, Int32, Int32, FSharpListTupleInt32, Double, Int32, Spin, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
Test(String, Int32, Int32, DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double, FSharpListTupleInt32, Double, Double, Int32, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double) | Executes a set of simulation runs for a spin Hamiltonian.
Top
See Also

Reference

Spin Class


Spin.Test Method (String, Int32, Int32, FSharpList(Tuple(Int32, Double[])), Int32, Spin, FSharpOption(Boolean), FSharpOption(FSharpList(Tuple(FSharpFunc(Qubit, Unit), Double))))

SpinTest Method (String, Int32, Int32, FSharpListTupleInt32, Double, Int32, Spin, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double)
Executes a set of simulation runs for a spin Hamiltonian.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Test :
        tag : string *
        repeats : int *
        trotter : int *
        schedule : FSharpList<Tuple<int, float[]>> *
        res : int *
        spin : Spin *
        runonce : FSharpOption<bool> *
        decohereModel : FSharpOption<FSharpList<Tuple<FSharpFunc<Qubit, Unit>, float>>> -> unit

Parameters

tag
Type: SystemString
The output label for logging.
repeats
Type: SystemInt32
The number of simulations to run.
trotter
Type: SystemInt32
The Trotter number to use.
schedule
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Double
The annealing schedule to use. Each entry in the list is a tuple whose first entry is a time step and whose second entry is an array of annealing values. Annealing values for time steps in between entries are computed by linearly interpolating between those for the previous and next entries. The list must be in ascneding order by time step.
res
Type: SystemInt32
The resolution of the simulation, in time steps. Larger values may increase speed but will reduce the granularity of output. Note that this must evenly divide the final time in the annealing schedule.
spin
Type: Microsoft.Research.LiquidSpin
The actual Hamiltonian to be simulated.
runonce
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to only run the simulation once and perform repeated 'virtual measurements'. The default is false, which means to run the simulation and measure each time.
decohereModel
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListTuple FSharpFuncQubit, Unit, Double
An optional decoherence model to use for this simulation. See Hamiltonian.decohereModel for more information. The default is no decoherence.
See Also

Reference

Spin Class
Test Overload


Spin.Test Method (String, Int32, Int32, Dictionary(Int32, Double), Dictionary(Tuple(Int32, Int32), Double), FSharpList(Tuple(Int32, Double, Double)), Int32, FSharpOption(Boolean), FSharpOption(FSharpList(Tuple(FSharpFunc(Qubit, Unit), Double))))

SpinTest Method (String, Int32, Int32, DictionaryInt32, Double, DictionaryTupleInt32, Int32, Double, FSharpListTupleInt32, Double, Double, Int32, FSharpOptionBoolean, FSharpOptionFSharpListTupleFSharpFuncQubit, Unit, Double)
Executes a set of simulation runs for a spin Hamiltonian.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Test :
        tag : string *
        repeats : int *
        trotter : int *
        hs : Dictionary<int, float> *
        Js : Dictionary<Tuple<int, int>, float> *
        gammalambda : FSharpList<Tuple<int, float, float>> *
        res : int *
        runonce : FSharpOption<bool> *
        decohereModel : FSharpOption<FSharpList<Tuple<FSharpFunc<Qubit, Unit>, float>>> -> unit

Parameters

tag
Type: SystemString
The output label for logging.
repeats
Type: SystemInt32
The number of simulations to run.
trotter
Type: SystemInt32
The Trotter number to use.
hs
Type: System.Collections.GenericDictionary Int32, Double
A Dictionary that maps a qubit id to that qubit's bias strength (Z term coefficient).
Js
Type: System.Collections.GenericDictionary Tuple Int32, Int32 , Double
A Dictionary that maps a pair of qubit id's to the pair's coupling strength (ZZ coefficient).
gammalambda
Type: Microsoft.FSharp.CollectionsFSharpListTuple Int32, Double, Double
List of (time,gamma,lambda) tuples that define the annealing schedule. Each entry in the list is a tuple whose first entry is a time step and whose second entry is an array of annealing values. Annealing values for time steps in between entries are computed by linearly interpolating between those for the previous and next entries. The list must be in ascneding order by time step.
res
Type: SystemInt32
The resolution of the simulation, in time steps. Larger values may increase speed but will reduce the granularity of output. Note that this must evenly divide the final time in the annealing schedule.
runonce
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option to only run the simulation once and perform repeated 'virtual measurements'. The default is false, which means to run the simulation and measure each time.
decohereModel
Type: Microsoft.FSharp.CoreFSharpOptionFSharpListTuple FSharpFuncQubit, Unit, Double
An optional decoherence model to use for this simulation. See Hamiltonian.decohereModel for more information. The default is no decoherence.
See Also

Reference

Spin Class
Test Overload


SpinTerm Class

SpinTerm Class
A single term in a Spin Hamiltonian.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidSpinTerm

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type SpinTerm =  class end

The SpinTerm type exposes the following members.

Constructors
 | Name | Description
Public method | SpinTerm(Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Double) | Initializes a new SpinTerm instance.
Public method | SpinTerm(Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, FSharpListInt32, Double) | Initializes a new SpinTerm instance.
Top
Properties
 | Name | Description
Public property | Amplitude | The numerical coefficient ('strength') leading this term.
Public property | Schedule | The numerical id (zero-based) of the annealing schedule corresponding to this term.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


SpinTerm Constructor

SpinTerm Constructor
Overload List
 | Name | Description
Public method | SpinTerm(Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Double) | Initializes a new SpinTerm instance.
Public method | SpinTerm(Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, FSharpListInt32, Double) | Initializes a new SpinTerm instance.
Top
See Also

Reference

SpinTerm Class


SpinTerm Constructor (Int32, FSharpFunc(Double, FSharpFunc(FSharpList(Qubit), Unit)), Double)

SpinTerm Constructor (Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, Double)
Initializes a new SpinTerm instance.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        s : int *
        o : FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, Unit>> *
        a : float -> SpinTerm

Parameters

s
Type: SystemInt32
The numerical id, zero-based, of the annealing schedule corresponding to this term.
o
Type: Microsoft.FSharp.CoreFSharpFuncDouble, FSharpFuncFSharpListQubit , Unit
A function which performs the operation of this term over a given angle.
a
Type: SystemDouble
The numerical coefficient ('strength') leading this term.
See Also

Reference

SpinTerm Class
SpinTerm Overload


SpinTerm Constructor (Int32, FSharpFunc(Double, FSharpFunc(FSharpList(Qubit), Unit)), FSharpList(Int32), Double)

SpinTerm Constructor (Int32, FSharpFuncDouble, FSharpFuncFSharpListQubit, Unit, FSharpListInt32, Double)
Initializes a new SpinTerm instance.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        s : int *
        o : FSharpFunc<float, FSharpFunc<FSharpList<Qubit>, Unit>> *
        idx : FSharpList<int> *
        a : float -> SpinTerm

Parameters

s
Type: SystemInt32
The numerical id, zero-based, of the annealing schedule corresponding to this term.
o
Type: Microsoft.FSharp.CoreFSharpFuncDouble, FSharpFuncFSharpListQubit , Unit
A function which performs the operation of this term over a given angle.
idx
Type: Microsoft.FSharp.CollectionsFSharpListInt32
A list of integer indices specifying the qubits to apply this term to.
a
Type: SystemDouble
The numerical coefficient ('strength') leading this term.
See Also

Reference

SpinTerm Class
SpinTerm Overload


SpinTerm Properties

SpinTerm Properties

The SpinTerm type exposes the following members.

Properties
 | Name | Description
Public property | Amplitude | The numerical coefficient ('strength') leading this term.
Public property | Schedule | The numerical id (zero-based) of the annealing schedule corresponding to this term.
Top
See Also

Reference

SpinTerm Class


SpinTerm.Amplitude Property

SpinTermAmplitude Property
The numerical coefficient ('strength') leading this term.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Amplitude : float with get

Property Value

Type: Double
See Also

Reference

SpinTerm Class


SpinTerm.Schedule Property

SpinTermSchedule Property
The numerical id (zero-based) of the annealing schedule corresponding to this term.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Schedule : int with get

Property Value

Type: Int32
See Also

Reference

SpinTerm Class


SpinTerm Methods

SpinTerm Methods

The SpinTerm type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

SpinTerm Class


Stabilizer Class

Stabilizer Class
A stabilizer-based simulator based on CHP by Scott Aaronson and Daniel Gottesman. See arXiv:quant-ph/0406196 for more details.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidStabilizer

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Stabilizer =  class end

The Stabilizer type exposes the following members.

Constructors
 | Name | Description
Public method | Stabilizer | Creates a tableau to run a circuit in the stabilizer simulator.
Top
Properties
 | Name | Description
Public property | Item | The current measured value for a qubit.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | Gaussian | Performs a Gaussian elimination to put the tableau in quasi upper triangluar form.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the circuit.
Public method | ShowState | Dumps the stabilizer tableau.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Stabilizer Constructor

Stabilizer Constructor
Creates a tableau to run a circuit in the stabilizer simulator.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        circ : Circuit *
        ket : Ket -> Stabilizer

Parameters

circ
Type: Microsoft.Research.LiquidCircuit
The crcuit that will be run in stabilizer mode.
ket
Type: Microsoft.Research.LiquidKet
The state vector that will be used for execution.
See Also

Reference

Stabilizer Class


Stabilizer Properties

Stabilizer Properties

The Stabilizer type exposes the following members.

Properties
 | Name | Description
Public property | Item | The current measured value for a qubit.
Top
See Also

Reference

Stabilizer Class


Stabilizer.Item Property

StabilizerItem Property
The current measured value for a qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Item : Tuple<bool, Bit> with get

Parameters

i
Type: SystemInt32
The index of the qubit in the simulator's state vector.

Property Value

Type: Tuple Boolean, Bit
Remarks
This property has a tuple value. The first item is a flag indicating whether the last measurement was random or forced, and the second item is the result of the last measurement as a Bit.

As with any qubit, the Bit will be Unknown if the qubit has interacted since it was last measured.

See Also

Reference

Stabilizer Class


Stabilizer Methods

Stabilizer Methods

The Stabilizer type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | Gaussian | Performs a Gaussian elimination to put the tableau in quasi upper triangluar form.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the circuit.
Public method | ShowState | Dumps the stabilizer tableau.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Stabilizer Class


Stabilizer.Gaussian Method

StabilizerGaussian Method
Performs a Gaussian elimination to put the tableau in quasi upper triangluar form.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Gaussian : unit -> unit
See Also

Reference

Stabilizer Class


Stabilizer.Run Method

StabilizerRun Method
Runs the circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member Run :
        circuit : FSharpOption<Circuit> *
        dumpAll : FSharpOption<bool> *
        gaussian : FSharpOption<bool> -> unit

Parameters

circuit
Type: Microsoft.FSharp.CoreFSharpOptionCircuit
An optional different circuit to run. This allows the tableau to be reused for different circuits. The default is to used the circuit the tableau was created with.
dumpAll
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating that the tableau state should be written to the log after each gate application. The default is false, indicating not to log.
gaussian
Type: Microsoft.FSharp.CoreFSharpOptionBoolean
An option indicating that the tableau state should be simplified using Gaussian elimination before being logged. This is ignored if dumpall is false. The default is false, indicating not to perform Gaussian elimination.
See Also

Reference

Stabilizer Class


Stabilizer.ShowState Method

StabilizerShowState Method
Dumps the stabilizer tableau.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member ShowState :
        f : FSharpFunc<int, FSharpFunc<string, Unit>> *
        level : int -> unit

Parameters

f
Type: Microsoft.FSharp.CoreFSharpFuncInt32, FSharpFuncString, Unit
The output function to use. A common output function is showLogInd.
level
Type: SystemInt32
The indentation level.
See Also

Reference

Stabilizer Class


Steane7 Class

Steane7 Class
Implementation of a Steane 7-bit quantum error correcting code, [[7,1,3]], based on the QECC class.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidQECC
Microsoft.Research.LiquidSteane7

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type Steane7 =
    class
        inherit QECC
    end

The Steane7 type exposes the following members.

Constructors
 | Name | Description
Public method | Steane7 | Constructs a Steane code implementation for a circuit.
Top
Properties
 | Name | Description
Public property | Circuit | The error-correcting circuit built by Compile. The circuit will be built now if it hasn't already been. (Inherited from QECC.)
Public property | Ket | The state vector for the compiled code. (Inherited from QECC.)
Public property | NumFixed | The number of syndrome fixups performed.
Top
Methods
 | Name | Description
Public method | Compile | Compiles the target circuit into an error-correcting version. (Inherited from QECC.)
Public method | Decode | Decodes a set of measured physical qubits to get the measured value for a logical qubit. (Overrides QECCDecode(FSharpListQubit).)
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetMeasured | Gets the measured values of the physical qubits that make up a logical qubit and returns them combined into a single integer, one bit per qubit. (Inherited from QECC.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Inject | Injects dephasing errors with the given probability into the error-correcting circuit. (Inherited from QECC.)
Public method | Log2Phys | Gets the physical qubits that make up a logical qubit. (Inherited from QECC.)
Public method | Prep | A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method. (Overrides QECCPrep(FSharpListQubit).)
Public method | Replace | Gets a replacement physical gate for an input logical gate. The replacement may wrap a full Circuit. (Inherited from QECC.)
Public method | Syndrome | A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method. (Overrides QECCSyndrome(FSharpListQubit).)
 | Test1 | Tests the Steane7 QECC on a single logical qubit with forced X, Y, and Z error injections.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Remarks
This code uses 7 physical qubits per logical qubit. It also requires 6 ancillae.
See Also

Reference

Microsoft.Research.Liquid Namespace
Microsoft.Research.LiquidQECC


Steane7 Constructor

Steane7 Constructor
Constructs a Steane code implementation for a circuit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new :
        tgt : Circuit -> Steane7

Parameters

tgt
Type: Microsoft.Research.LiquidCircuit
The target Circuit to build an error-correcting circuit for.
See Also

Reference

Steane7 Class


Steane7 Properties

Steane7 Properties

The Steane7 type exposes the following members.

Properties
 | Name | Description
Public property | Circuit | The error-correcting circuit built by Compile. The circuit will be built now if it hasn't already been. (Inherited from QECC.)
Public property | Ket | The state vector for the compiled code. (Inherited from QECC.)
Public property | NumFixed | The number of syndrome fixups performed.
Top
See Also

Reference

Steane7 Class


Steane7.NumFixed Property

Steane7NumFixed Property
The number of syndrome fixups performed.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member NumFixed : int with get, set

Property Value

Type: Int32
See Also

Reference

Steane7 Class


Steane7 Methods

Steane7 Methods

The Steane7 type exposes the following members.

Methods
 | Name | Description
Public method | Compile | Compiles the target circuit into an error-correcting version. (Inherited from QECC.)
Public method | Decode | Decodes a set of measured physical qubits to get the measured value for a logical qubit. (Overrides QECCDecode(FSharpListQubit).)
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetMeasured | Gets the measured values of the physical qubits that make up a logical qubit and returns them combined into a single integer, one bit per qubit. (Inherited from QECC.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Inject | Injects dephasing errors with the given probability into the error-correcting circuit. (Inherited from QECC.)
Public method | Log2Phys | Gets the physical qubits that make up a logical qubit. (Inherited from QECC.)
Public method | Prep | A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method. (Overrides QECCPrep(FSharpListQubit).)
Public method | Replace | Gets a replacement physical gate for an input logical gate. The replacement may wrap a full Circuit. (Inherited from QECC.)
Public method | Syndrome | A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method. (Overrides QECCSyndrome(FSharpListQubit).)
 | Test1 | Tests the Steane7 QECC on a single logical qubit with forced X, Y, and Z error injections.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Steane7 Class


Steane7.Decode Method

Steane7Decode Method
Decodes a set of measured physical qubits to get the measured value for a logical qubit.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Decode :
        qs : FSharpList<Qubit> -> Tuple<Bit, int>
override Decode :
        qs : FSharpList<Qubit> -> Tuple<Bit, int>

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The physical qubits to decode. They must already have been measured.

Return Value

Type: Tuple Bit, Int32
A tuple containing the logical measured value of the logical qubit, either Zero or One, and the Hamming distance from the physical state to the code space.
See Also

Reference

Steane7 Class


Steane7.Prep Method

Steane7Prep Method
A gate function that prepares a logical |0> qubit. This gets compiled into the error-correcting circuit by the Compile method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Prep :
        qs : FSharpList<Qubit> -> unit
override Prep :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The physical qubits for the logical qubit. This contains both data and syndrome qubits, but no ancillae.
See Also

Reference

Steane7 Class


Steane7.Syndrome Method

Steane7Syndrome Method
A gate function that measures the physical qubits for a single logical qubit and applies any necessary corrections. This gets compiled into the error-correcting circuit by the Compile method.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
abstract Syndrome :
        qs : FSharpList<Qubit> -> unit
override Syndrome :
        qs : FSharpList<Qubit> -> unit

Parameters

qs
Type: Microsoft.FSharp.CollectionsFSharpListQubit
The ancilla qubits followed by physical qubits for the logical qubit. The number of ancillae was passed to the QECC constructor.
See Also

Reference

Steane7 Class


Steane7.Test1 Method

Steane7Test1 Method
Tests the Steane7 QECC on a single logical qubit with forced X, Y, and Z error injections.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Test1 : unit -> unit
Remarks
The test verifies that the Steane 7 code properly decodes a prepared logical qubit in the face of all possible single-qubit dephasing errors on each of the 7 physical qubits.
See Also

Reference

Steane7 Class


Tests Class

Tests Class
A collection of sample Liquid simulations and tests, plus some utility routines to make it easier to write new samples.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidTests

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SealedAttribute>]
type Tests =  class end

The Tests type exposes the following members.

Methods
Name | Description
__Big | Runs an entanglement test for state vectors from 16 to 22 qubits in size.
__Chem | Runs a simple quantum chemistry simulation. This is the same as the __ChemFull sample, with common values for the detailed parameters: test 0, 32 Trotter steps, first-order Trotter, 28 bits of accuracy, and no additional options. See the Users Manual for more information.
__ChemFull | Runs a quantum chemistry simulation. See the Users Manual for more information.
__Correct | Test various permutations for correctness using teleport
__EIGS | Validates that LAPACK is properly installed.
__Entangle1 | Runs a simple gate sequence that entangles all the qubits in the state vector.
__Entangle2 | Runs a simple gate sequence that entangles all the qubits in the state vector. The sequence is run three different ways to demonstrate the difference in timings.
__Entangles | Runs 100 entanglement tests on 16 qubits to show the statistics on the bits measured.
__EntEnt | Demonstrates a couple of simple entanglement entropy calculations.
__EPR | Renders a small EPR circuit that entangles two qubits.
__Ferro | Simulates a ferromagnetic chain using a first-quantized Hamiltonian.
__JointCNOT | Demonstrates and tests various ways of implementing CNOT from joint measurements and single-qubit Clifford gates.
__Noise1 | Demonstrates the use of a complex noise model with error correction. See the Users Manual for more information.
__NoiseAmp | Demonstrates a complex noise model. See the Users Manual for more information.
__QECC | Demonstrates some examples of error correction and stabilizer simulation. See the Users Manual for details.
__QFTbench | Benchmarks the Quantum Fourier Transform at the heart of the Shor algorithm.
__QLSA | Demonstrates the Quantum Linear Algebra algorithm from Harrow, Hassidim, and Lloyd. See the Users Manual for more information.
__QuAM | Demonstrates the Quantum Associative Memory algorithm from Ventura and Martinez. See the Users Manual for more information.
__QWalk | Demonstrates the Quantum PageRank algorithm from Paparo and Martin-Delgado. See the Users Manual for more information.
__Ramsey33 | Solves for the (3,3) Ramsey number. See this paper for details.
__SG | Simulates a spin glass using a first-quantized Hamiltonian.
__Shor | Runs the classic Shor factoring algorithm.
__Steane7 | Validates that the Steane 7 code is correct. See Steane7.Test1 for more details.
__Teleport | Renders and runs the classic quantum teleportation algorithm.
__TSP | Solves the traveling salesman problem.
RenderTest | Renders and dumps test circuits in a variety of formats and detail levels.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Tests Methods

Tests Methods

The Tests type exposes the following members.

Methods
Name | Description
__Big | Runs an entanglement test for state vectors from 16 to 22 qubits in size.
__Chem | Runs a simple quantum chemistry simulation. This is the same as the __ChemFull sample, with common values for the detailed parameters: test 0, 32 Trotter steps, first-order Trotter, 28 bits of accuracy, and no additional options. See the Users Manual for more information.
__ChemFull | Runs a quantum chemistry simulation. See the Users Manual for more information.
__Correct | Test various permutations for correctness using teleport
__EIGS | Validates that LAPACK is properly installed.
__Entangle1 | Runs a simple gate sequence that entangles all the qubits in the state vector.
__Entangle2 | Runs a simple gate sequence that entangles all the qubits in the state vector. The sequence is run three different ways to demonstrate the difference in timings.
__Entangles | Runs 100 entanglement tests on 16 qubits to show the statistics on the bits measured.
__EntEnt | Demonstrates a couple of simple entanglement entropy calculations.
__EPR | Renders a small EPR circuit that entangles two qubits.
__Ferro | Simulates a ferromagnetic chain using a first-quantized Hamiltonian.
__JointCNOT | Demonstrates and tests various ways of implementing CNOT from joint measurements and single-qubit Clifford gates.
__Noise1 | Demonstrates the use of a complex noise model with error correction. See the Users Manual for more information.
__NoiseAmp | Demonstrates a complex noise model. See the Users Manual for more information.
__QECC | Demonstrates some examples of error correction and stabilizer simulation. See the Users Manual for details.
__QFTbench | Benchmarks the Quantum Fourier Transform at the heart of the Shor algorithm.
__QLSA | Demonstrates the Quantum Linear Algebra algorithm from Harrow, Hassidim, and Lloyd. See the Users Manual for more information.
__QuAM | Demonstrates the Quantum Associative Memory algorithm from Ventura and Martinez. See the Users Manual for more information.
__QWalk | Demonstrates the Quantum PageRank algorithm from Paparo and Martin-Delgado. See the Users Manual for more information.
__Ramsey33 | Solves for the (3,3) Ramsey number. See this paper for details.
__SG | Simulates a spin glass using a first-quantized Hamiltonian.
__Shor | Runs the classic Shor factoring algorithm.
__Steane7 | Validates that the Steane 7 code is correct. See Steane7.Test1 for more details.
__Teleport | Renders and runs the classic quantum teleportation algorithm.
__TSP | Solves the traveling salesman problem.
RenderTest | Renders and dumps test circuits in a variety of formats and detail levels.
Top
See Also

Reference

Tests Class


Tests.__Big Method

Tests__Big Method
Runs an entanglement test for state vectors from 16 to 22 qubits in size.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Big : unit -> unit
See Also

Reference

Tests Class


Tests.__Chem Method

Tests__Chem Method
Runs a simple quantum chemistry simulation. This is the same as the __ChemFull sample, with common values for the detailed parameters: test 0, 32 Trotter steps, first-order Trotter, 28 bits of accuracy, and no additional options. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Chem :
        mol : string -> unit

Parameters

mol
Type: SystemString
The name of the molecule to simulate. Entering an empty string, "", will display the list of available molecules.
See Also

Reference

Tests Class


Tests.__ChemFull Method

Tests__ChemFull Method
Runs a quantum chemistry simulation. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __ChemFull :
        mol : string *
        test : int *
        opts : string *
        trot : int *
        bits : int *
        order : int -> unit

Parameters

mol
Type: SystemString
The name of the molecule to simulate. Entering an empty string, "", will display the list of available molecules.
test
Type: SystemInt32
The test number to run, from the .dat file.
opts
Type: SystemString
A string of any options you want to set. See the Users Manual for more information.
trot
Type: SystemInt32
The Trotter parameter; that is, number of Trotter steps per time step.
bits
Type: SystemInt32
The number of bits of accuracy desired in the phase estimation.
order
Type: SystemInt32
The order of Trotter approximation to use, 1 or 2.
See Also

Reference

Tests Class


Tests.__Correct Method

Tests__Correct Method
Test various permutations for correctness using teleport

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Correct : unit -> unit
See Also

Reference

Tests Class


Tests.__EIGS Method

Tests__EIGS Method
Validates that LAPACK is properly installed.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __EIGS : unit -> unit
See Also

Reference

Tests Class


Tests.__Entangle1 Method

Tests__Entangle1 Method
Runs a simple gate sequence that entangles all the qubits in the state vector.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Entangle1 :
        entSiz : int -> unit

Parameters

entSiz
Type: SystemInt32
The number of qubits desired in the state vector.
Remarks
This sample displays detailed timing and memory usage information, and so allows you to see how Liquid scales as the state vector size grows.
See Also

Reference

Tests Class


Tests.__Entangle2 Method

Tests__Entangle2 Method
Runs a simple gate sequence that entangles all the qubits in the state vector. The sequence is run three different ways to demonstrate the difference in timings.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Entangle2 :
        entSiz : int -> unit

Parameters

entSiz
Type: SystemInt32
The number of qubits desired in the state vector.
Remarks
This test executes the same gate sequence in three different ways:
  • As a simple sequence of gates. This is essentially the same as the __Entangle1 sample.
  • As a compiled circuit.
  • As a compiled circuit that has been optimized by calling GrowGates.
See Also

Reference

Tests Class


Tests.__Entangles Method

Tests__Entangles Method
Runs 100 entanglement tests on 16 qubits to show the statistics on the bits measured.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Entangles : unit -> unit
See Also

Reference

Tests Class


Tests.__EntEnt Method

Tests__EntEnt Method
Demonstrates a couple of simple entanglement entropy calculations.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __EntEnt : unit -> unit
See Also

Reference

Tests Class


Tests.__EPR Method

Tests__EPR Method
Renders a small EPR circuit that entangles two qubits.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __EPR : unit -> unit
See Also

Reference

Tests Class


Tests.__Ferro Method

Tests__Ferro Method
Simulates a ferromagnetic chain using a first-quantized Hamiltonian.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Ferro :
        full : bool *
        runonce : bool -> unit

Parameters

full
Type: SystemBoolean
Whether to run all chain variations (isolated, ferromagnetic, anti-ferromagnetic, freeze up, freese down, and freeze up/down) or just the last variation, freeze up/down.
runonce
Type: SystemBoolean
For each variation, whether to run the circuit once and then do "virtual sampling" from the state vector, or to run the circuit and perform full simulated measurements each time.
See Also

Reference

Tests Class


Tests.__JointCNOT Method

Tests__JointCNOT Method
Demonstrates and tests various ways of implementing CNOT from joint measurements and single-qubit Clifford gates.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __JointCNOT : unit -> unit
See Also

Reference

Tests Class


Tests.__Noise1 Method

Tests__Noise1 Method
Demonstrates the use of a complex noise model with error correction. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Noise1 :
        depth : int *
        iters : int *
        prob : float -> unit

Parameters

depth
Type: SystemInt32
The number of idle gates to include in the circuit.
iters
Type: SystemInt32
The number of executions to run, for statistical purposes.
prob
Type: SystemDouble
The probability of an error occurring.
See Also

Reference

Tests Class


Tests.__NoiseAmp Method

Tests__NoiseAmp Method
Demonstrates a complex noise model. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __NoiseAmp : unit -> unit
See Also

Reference

Tests Class


Tests.__QECC Method

Tests__QECC Method
Demonstrates some examples of error correction and stabilizer simulation. See the Users Manual for details.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __QECC : unit -> unit
See Also

Reference

Tests Class


Tests.__QFTbench Method

Tests__QFTbench Method
Benchmarks the Quantum Fourier Transform at the heart of the Shor algorithm.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __QFTbench : unit -> unit
See Also

Reference

Tests Class


Tests.__QLSA Method

Tests__QLSA Method
Demonstrates the Quantum Linear Algebra algorithm from Harrow, Hassidim, and Lloyd. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __QLSA : unit -> unit
See Also

Reference

Tests Class


Tests.__QuAM Method

Tests__QuAM Method
Demonstrates the Quantum Associative Memory algorithm from Ventura and Martinez. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __QuAM : unit -> unit
See Also

Reference

Tests Class


Tests.__QWalk Method

Tests__QWalk Method
Demonstrates the Quantum PageRank algorithm from Paparo and Martin-Delgado. See the Users Manual for more information.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __QWalk :
        which : string -> unit

Parameters

which
Type: SystemString
The web graph to use. There are three built-in graphs: tiny, tree, and graph. Alternatively, the path to a .graph file may be provided.
See Also

Reference

Tests Class


Tests.__Ramsey33 Method

Tests__Ramsey33 Method
Solves for the (3,3) Ramsey number. See this paper for details.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Ramsey33 : unit -> unit
See Also

Reference

Tests Class


Tests.__SG Method

Tests__SG Method
Simulates a spin glass using a first-quantized Hamiltonian.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __SG : unit -> unit
See Also

Reference

Tests Class


Tests.__Shor Method

Tests__Shor Method
Runs the classic Shor factoring algorithm.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Shor :
        N : int *
        doCirc : bool -> unit

Parameters

N
Type: SystemInt32
The number to factor.
doCirc
Type: SystemBoolean
Whether or not to optimize the circuit.
See Also

Reference

Tests Class


Tests.__Steane7 Method

Tests__Steane7 Method
Validates that the Steane 7 code is correct. See Steane7.Test1 for more details.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Steane7 : unit -> unit
See Also

Reference

Tests Class


Tests.__Teleport Method

Tests__Teleport Method
Renders and runs the classic quantum teleportation algorithm.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __Teleport : unit -> unit
See Also

Reference

Tests Class


Tests.__TSP Method

Tests__TSP Method
Solves the traveling salesman problem.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __TSP :
        nCities : int -> unit

Parameters

nCities
Type: SystemInt32
The number of cities to include in the map, from 5 to 8.
See Also

Reference

Tests Class


Tests.RenderTest Method

TestsRenderTest Method
Renders and dumps test circuits in a variety of formats and detail levels.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member RenderTest :
        name : string *
        circ : Circuit *
        ket : Ket -> unit

Parameters

name
Type: SystemString
The base name for the output files.
circ
Type: Microsoft.Research.LiquidCircuit
The Circuit to render.
ket
Type: Microsoft.Research.LiquidKet
The state vector for the circuit.
Remarks
Three versions of the circuit will be dumped to the log file:
  • The base circuit.
  • The circuit aggressively folded to maximize parallelism.
  • The circuit with gates grown to a maximum of 11 inputs, and then folded.
Four pairs of graphics files will be created. For each version, both an SVG version, with a .htm extension, and a Tik-Z version, with a .tex, will be created.
  • The base circuit.
  • The circuit normally folded to use "easy" parallelism.
  • The circuit aggressively folded to maximize parallelism.
  • The circuit with gates grown to a maximum of 11 inputs, and then folded.
See Also

Reference

Tests Class


Util Class

Util Class
General utilities used by the rest of the system
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidUtil

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<AbstractClassAttribute>]
[<SealedAttribute>]
type Util =  class end

The Util type exposes the following members.

Properties
Name | Description
copyright | Copyright notice for Liquid.
outputPrefix | Global override for the prefix used for output functions (show and variants).
sqrt2 | Highly accurate square root of 2, for use building unitary matrices.
Top
Methods
Name | Description
__show | Shows a line of output. This is a command line-callable routine.
getFlgPar | Extracts a boolean macro definition from a command option dictionary.
getFltPar | Extracts a float macro definition from a command option dictionary.
getIntPar | Extracts an integer macro definition from a command option dictionary.
getIntsPar | Extracts an integer list macro definition from a command option dictionary.
getStrPar | Extracts a string macro definition from a command option dictionary.
Normal | Add a Normal distribution to the System.Random class. This is an extension method and may be used as if it were an instance method on Random.
PermAry | Create a random permutation array (call .permute with results) This is an extension method and may be used as if it were an instance method on Random.
procStats | Gets current process memory usage statistics.
showa | Shows a line of output to the console and the log file.
showBareInd | Shows an indented line of output, with no prefix, to the console and log file. This routine is used by or with various Dump() routines.
showBareLogInd | Shows an indented line of output, with no prefix, to the log file. This routine is used by or with various Dump() routines.
showDump | Dumps out a string with with an optional indentation.
showInd | Shows an indented line of output to the console and log file. This routine is used by or with various Dump() routines.
showLoga | Shows a line of output to the log file.
showLogInd | Shows an indented line of output to the log file. This routine is used by or with various Dump() routines.
showProcStats | Print process memory usage statistics to the console and log file.
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Util Properties

Util Properties

The Util type exposes the following members.

Properties
Name | Description
copyright | Copyright notice for Liquid.
outputPrefix | Global override for the prefix used for output functions (show and variants).
sqrt2 | Highly accurate square root of 2, for use building unitary matrices.
Top
See Also

Reference

Util Class


Util.copyright Property

Utilcopyright Property
Copyright notice for Liquid.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member copyright : FSharpFunc<Unit, Unit> with get

Property Value

Type: FSharpFuncUnit, Unit
See Also

Reference

Util Class


Util.outputPrefix Property

UtiloutputPrefix Property
Global override for the prefix used for output functions (show and variants).

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member outputPrefix : string with get, set

Property Value

Type: String
See Also

Reference

Util Class


Util.sqrt2 Property

Utilsqrt2 Property
Highly accurate square root of 2, for use building unitary matrices.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member sqrt2 : float with get

Property Value

Type: Double
See Also

Reference

Util Class


Util Methods

Util Methods

The Util type exposes the following members.

Methods
Name | Description
__show | Shows a line of output. This is a command line-callable routine.
getFlgPar | Extracts a boolean macro definition from a command option dictionary.
getFltPar | Extracts a float macro definition from a command option dictionary.
getIntPar | Extracts an integer macro definition from a command option dictionary.
getIntsPar | Extracts an integer list macro definition from a command option dictionary.
getStrPar | Extracts a string macro definition from a command option dictionary.
Normal | Add a Normal distribution to the System.Random class. This is an extension method and may be used as if it were an instance method on Random.
PermAry | Create a random permutation array (call .permute with results) This is an extension method and may be used as if it were an instance method on Random.
procStats | Gets current process memory usage statistics.
showa | Shows a line of output to the console and the log file.
showBareInd | Shows an indented line of output, with no prefix, to the console and log file. This routine is used by or with various Dump() routines.
showBareLogInd | Shows an indented line of output, with no prefix, to the log file. This routine is used by or with various Dump() routines.
showDump | Dumps out a string with with an optional indentation.
showInd | Shows an indented line of output to the console and log file. This routine is used by or with various Dump() routines.
showLoga | Shows a line of output to the log file.
showLogInd | Shows an indented line of output to the log file. This routine is used by or with various Dump() routines.
showProcStats | Print process memory usage statistics to the console and log file.
Top
See Also

Reference

Util Class


Util.__show Method

Util__show Method
Shows a line of output. This is a command line-callable routine.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member __show :
        str : string -> unit

Parameters

str
Type: SystemString
String argument to show
See Also

Reference

Util Class


Util.getFlgPar Method

UtilgetFlgPar Method
Extracts a boolean macro definition from a command option dictionary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member getFlgPar :
        dic : Dictionary<string, string> *
        nam : string *
        def : bool -> bool

Parameters

dic
Type: System.Collections.GenericDictionary String, String
The dictionary to search
nam
Type: SystemString
The macro name
def
Type: SystemBoolean
The default value to return if the name is not found in the dictionary

Return Value

Type: Boolean
Macro value if found, or else default value
See Also

Reference

Util Class


Util.getFltPar Method

UtilgetFltPar Method
Extracts a float macro definition from a command option dictionary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member getFltPar :
        dic : Dictionary<string, string> *
        nam : string *
        def : float -> float

Parameters

dic
Type: System.Collections.GenericDictionary String, String
The dictionary to search
nam
Type: SystemString
The macro name
def
Type: SystemDouble
The default value to return if the name is not found in the dictionary

Return Value

Type: Double
Macro value if found, or else default value
See Also

Reference

Util Class


Util.getIntPar Method

UtilgetIntPar Method
Extracts an integer macro definition from a command option dictionary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member getIntPar :
        dic : Dictionary<string, string> *
        nam : string *
        def : int -> int

Parameters

dic
Type: System.Collections.GenericDictionary String, String
The dictionary to search
nam
Type: SystemString
The macro name
def
Type: SystemInt32
The default value to return if the name is not found in the dictionary

Return Value

Type: Int32
Macro value if found, or else default value
See Also

Reference

Util Class


Util.getIntsPar Method

UtilgetIntsPar Method
Extracts an integer list macro definition from a command option dictionary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member getIntsPar :
        dic : Dictionary<string, string> *
        nam : string *
        def : FSharpList<int> -> FSharpList<int>

Parameters

dic
Type: System.Collections.GenericDictionary String, String
The dictionary to search
nam
Type: SystemString
The macro name
def
Type: Microsoft.FSharp.CollectionsFSharpListInt32
The default value to return if the name is not found in the dictionary

Return Value

Type: FSharpListInt32
Macro value if found, or else default value
See Also

Reference

Util Class


Util.getStrPar Method

UtilgetStrPar Method
Extracts a string macro definition from a command option dictionary.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member getStrPar :
        dic : Dictionary<string, string> *
        nam : string *
        def : string -> string

Parameters

dic
Type: System.Collections.GenericDictionary String, String
The dictionary to search
nam
Type: SystemString
The macro name
def
Type: SystemString
The default value to return if the name is not found in the dictionary

Return Value

Type: String
Macro value if found, or else default value
See Also

Reference

Util Class


Util.Normal Method

UtilNormal Method
Add a Normal distribution to the System.Random class. This is an extension method and may be used as if it were an instance method on Random.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member Normal :
        x : Random *
        mean : float *
        sd : float -> float

Parameters

x
Type: SystemRandom
The instance of System.Random (ignore)
mean
Type: SystemDouble
Mean of returned value
sd
Type: SystemDouble
Standard deviation of returned value

Return Value

Type: Double
Random Gaussian value
See Also

Reference

Util Class


Util.PermAry Method

UtilPermAry Method
Create a random permutation array (call .permute with results) This is an extension method and may be used as if it were an instance method on Random.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member PermAry :
        x : Random *
        len : int -> int[]

Parameters

x
Type: SystemRandom
The instance of System.Random (ignore)
len
Type: SystemInt32
Length of array to create

Return Value

Type: Int32
Randomized array
See Also

Reference

Util Class


Util.procStats Method

UtilprocStats Method
Gets current process memory usage statistics.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member procStats :
        doCollect : bool -> UtilprocStatsT

Parameters

doCollect
Type: SystemBoolean
Do a garbage collection before reporting?

Return Value

Type: UtilprocStatsT
procStatsT struct
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
Microsoft.Research.LiquidUtilprocStatsT


Util.show(a) Method

Utilshowa Method
Shows a line of output to the console and the log file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member show :
        fmt : PrintfFormat<'a, Unit, string, Unit> -> 'a

Parameters

fmt
Type: Microsoft.FSharp.CorePrintfFormata, Unit, String, Unit
printf format parameters

Type Parameters

a
Internal type of the printf string. The F# compiler will deduce this.

Return Value

Type: a
Internal printformat.
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
UtilshowLoga(PrintfFormata, Unit, String, Unit)
Util.logOpen
Util.logClose


Util.showBareInd Method

UtilshowBareInd Method
Shows an indented line of output, with no prefix, to the console and log file. This routine is used by or with various Dump() routines.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showBareInd :
        level : int *
        line : string -> unit

Parameters

level
Type: SystemInt32
The indentation level. Each level represents a two space indent.
line
Type: SystemString
The text to show.
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
UtilshowInd(Int32, String)
UtilshowLogInd(Int32, String)
UtilshowBareLogInd(Int32, String)


Util.showBareLogInd Method

UtilshowBareLogInd Method
Shows an indented line of output, with no prefix, to the log file. This routine is used by or with various Dump() routines.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showBareLogInd :
        level : int *
        line : string -> unit

Parameters

level
Type: SystemInt32
The indentation level. Each level represents a two space indent.
line
Type: SystemString
The text to show.
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
UtilshowInd(Int32, String)
UtilshowLogInd(Int32, String)
UtilshowBareInd(Int32, String)


Util.showDump Method

UtilshowDump Method
Dumps out a string with with an optional indentation.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showDump :
        fO : FSharpOption<FSharpFunc<int, FSharpFunc<string, Unit>>> *
        lO : FSharpOption<int> *
        str : string -> unit

Parameters

fO
Type: Microsoft.FSharp.CoreFSharpOptionFSharpFuncInt32, FSharpFuncString, Unit
The optional output function to use. The default is showLogInd.
lO
Type: Microsoft.FSharp.CoreFSharpOptionInt32
The optional indentation level. The default is 0.
str
Type: SystemString
String to output
See Also

Reference

Util Class


Util.showInd Method

UtilshowInd Method
Shows an indented line of output to the console and log file. This routine is used by or with various Dump() routines.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showInd :
        level : int *
        line : string -> unit

Parameters

level
Type: SystemInt32
The indentation level. Each level represents a two space indent.
line
Type: SystemString
The text to show.
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
UtilshowLogInd(Int32, String)
UtilshowBareInd(Int32, String)
UtilshowBareLogInd(Int32, String)


Util.showLog(a) Method

UtilshowLoga Method
Shows a line of output to the log file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showLog :
        fmt : PrintfFormat<'a, Unit, string, Unit> -> 'a

Parameters

fmt
Type: Microsoft.FSharp.CorePrintfFormata, Unit, String, Unit
printf format parameters

Type Parameters

a
Internal type of the printf string. The F# compiler will deduce this.

Return Value

Type: a
Internal printformat
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
Utilshowa(PrintfFormata, Unit, String, Unit)
Util.logOpen
Util.logClose


Util.showLogInd Method

UtilshowLogInd Method
Shows an indented line of output to the log file. This routine is used by or with various Dump() routines.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showLogInd :
        level : int *
        line : string -> unit

Parameters

level
Type: SystemInt32
The indentation level. Each level represents a two space indent.
line
Type: SystemString
The text to show.
See Also

Reference

Util Class
Microsoft.Research.Liquid Namespace
UtilshowInd(Int32, String)
UtilshowBareInd(Int32, String)
UtilshowBareLogInd(Int32, String)


Util.showProcStats Method

UtilshowProcStats Method
Print process memory usage statistics to the console and log file.

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
static member showProcStats :
        nam : string -> unit

Parameters

nam
Type: SystemString
Tag for this log entry, up to 12 characters
See Also

Reference

Util Class


Util.LQDAttribute Class

UtilLQDAttribute Class
Allows a function to be visable from a LIQUiD script or the command line
Inheritance Hierarchy
SystemObject
SystemAttribute
Microsoft.Research.LiquidUtilLQDAttribute

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SerializableAttribute>]
type LQDAttribute =
    class
        inherit Attribute
    end

The UtilLQDAttribute type exposes the following members.

Constructors
 | Name | Description
Public method | UtilLQDAttribute | Initializes a new instance of the UtilLQDAttribute class
Top
Properties
 | Name | Description
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)
Top
Methods
 | Name | Description
Public method | Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)
Public method | Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace

Copyright (c) 2015, 2016 Microsoft Corporation (all rights reserved)


Util.LQDAttribute Constructor

UtilLQDAttribute Constructor
Initializes a new instance of the UtilLQDAttribute class

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
new : unit -> LQDAttribute
See Also

Reference

UtilLQDAttribute Class


LQDAttribute Properties

LQDAttribute Properties

The UtilLQDAttribute type exposes the following members.

Properties
 | Name | Description
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)
Top
See Also

Reference

UtilLQDAttribute Class


LQDAttribute Methods

LQDAttribute Methods

The UtilLQDAttribute type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)
Public method | Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UtilLQDAttribute Class


Util.procStatsT Class

UtilprocStatsT Class
Current process memory usage statistics. Returned by the procStates function.
Inheritance Hierarchy
SystemObject
Microsoft.Research.LiquidUtilprocStatsT

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
[<SealedAttribute>]
[<SerializableAttribute>]
type procStatsT =
    class
        interface IEquatable<UtilprocStatsT>
        interface IStructuralEquatable
        interface IComparable<UtilprocStatsT>
        interface IComparable
        interface IStructuralComparable
    end

The UtilprocStatsT type exposes the following members.

Properties
 | Name | Description
Public property | peakVMMB | Peak virtual memory in megabytes
Public property | peakWSMB | Peak working set in megabytes
Public property | privMB | Private memory in megabytes
Public property | wsetMB | Working set in megabytes
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Microsoft.Research.Liquid Namespace
UtilprocStats(Boolean)


procStatsT Properties

procStatsT Properties

The UtilprocStatsT type exposes the following members.

Properties
 | Name | Description
Public property | peakVMMB | Peak virtual memory in megabytes
Public property | peakWSMB | Peak working set in megabytes
Public property | privMB | Private memory in megabytes
Public property | wsetMB | Working set in megabytes
Top
See Also

Reference

UtilprocStatsT Class


Util.procStatsT.peakVMMB Property

UtilprocStatsTpeakVMMB Property
Peak virtual memory in megabytes

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member peakVMMB : int with get

Property Value

Type: Int32
See Also

Reference

UtilprocStatsT Class


Util.procStatsT.peakWSMB Property

UtilprocStatsTpeakWSMB Property
Peak working set in megabytes

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member peakWSMB : int with get

Property Value

Type: Int32
See Also

Reference

UtilprocStatsT Class


Util.procStatsT.privMB Property

UtilprocStatsTprivMB Property
Private memory in megabytes

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member privMB : int with get

Property Value

Type: Int32
See Also

Reference

UtilprocStatsT Class


Util.procStatsT.wsetMB Property

UtilprocStatsTwsetMB Property
Working set in megabytes

Namespace: Microsoft.Research.Liquid
Assembly: Liquid1 (in Liquid1.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
F#
Copy
member wsetMB : int with get

Property Value

Type: Int32
See Also

Reference

UtilprocStatsT Class


procStatsT Methods

procStatsT Methods

The UtilprocStatsT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UtilprocStatsT Class