Arrays and Data doc comments fixed
This commit is contained in:
Родитель
c1b4ca10b0
Коммит
57efc725d6
|
@ -125,7 +125,7 @@ namespace Microsoft.Quantum.Canon
|
|||
/// be as long as the shorter of the inputs.
|
||||
///
|
||||
/// # Example
|
||||
/// ```Q#
|
||||
/// ```qsharp
|
||||
/// let left = [1, 3, 71];
|
||||
/// let right = [false, true];
|
||||
/// let pairs = Zip(left, right); // [(1, false), (3, true)]
|
||||
|
@ -240,7 +240,7 @@ namespace Microsoft.Quantum.Canon
|
|||
/// forth.
|
||||
///
|
||||
/// # Example
|
||||
/// ```Q#
|
||||
/// ```qsharp
|
||||
/// let array = [10, 11, 12, 13, 14, 15];
|
||||
/// // The following line returns [10, 12, 15].
|
||||
/// let subarray = Exclude([1, 3, 4], array);
|
||||
|
@ -302,7 +302,7 @@ namespace Microsoft.Quantum.Canon
|
|||
/// with `defaultElement`s until `output` has length `nElementsTotal`
|
||||
///
|
||||
/// # Example
|
||||
/// ```Q#
|
||||
/// ```qsharp
|
||||
/// let array = [10, 11, 12];
|
||||
/// // The following line returns [10, 12, 15, 2, 2, 2].
|
||||
/// let output = Pad(-6, array, 2);
|
||||
|
@ -340,7 +340,7 @@ namespace Microsoft.Quantum.Canon
|
|||
/// A new array of integers corresponding to values iterated over by `range`.
|
||||
///
|
||||
/// # Example
|
||||
/// ```Q#
|
||||
/// ```qsharp
|
||||
/// // The following returns [1,3,5,7];
|
||||
/// let array = IntArrayFromRange(1..2..8);
|
||||
/// ```
|
||||
|
@ -376,7 +376,7 @@ namespace Microsoft.Quantum.Canon
|
|||
/// will contain all remaining elements.
|
||||
///
|
||||
/// # Example
|
||||
/// ```Q#
|
||||
/// ```qsharp
|
||||
/// // The following returns [[1,5],[3],[7]];
|
||||
/// let (arr1, arr2) = SplitArray([2,1], [1,5,3,7]);
|
||||
/// ```
|
||||
|
|
|
@ -11,7 +11,9 @@ namespace Microsoft.Quantum.Canon
|
|||
/// # Summary
|
||||
/// Represents a single primitive term in the set of all dynamical generators, e.g.
|
||||
/// Hermitian operators, for which there exists a map from that generator
|
||||
/// to time-evolution by that that generator, through "EvolutionSet". The first element
|
||||
/// to time-evolution by that that generator, through "EvolutionSet".
|
||||
///
|
||||
/// The first element
|
||||
/// (Int[], Double[]) is indexes that single term -- For instance, the Pauli string
|
||||
/// XXY with coefficient 0.5 would be indexed by ([1,1,2], [0.5]). Alternatively,
|
||||
/// Hamiltonians parameterized by a continuous variable, such as X cos φ + Y sin φ,
|
||||
|
@ -35,8 +37,10 @@ namespace Microsoft.Quantum.Canon
|
|||
/// - @"microsoft.quantum.canon.evolutionset"
|
||||
newtype GeneratorIndex = ((Int[], Double[]), Int[]);
|
||||
|
||||
// is a collection of GeneratorTerms. We iterate over this
|
||||
|
||||
/// # Summary
|
||||
/// Represents a collection of `GeneratorIndex`es.
|
||||
///
|
||||
/// We iterate over this
|
||||
/// collection using a single-index integer, and the size of the
|
||||
/// collection is assumed to be known.
|
||||
///
|
||||
|
@ -58,14 +62,18 @@ namespace Microsoft.Quantum.Canon
|
|||
newtype Unitary = (Qubit[] => Unit : Adjoint, Controlled);
|
||||
|
||||
/// # Summary
|
||||
/// Represents a unitary time-evolution operator. The first parameter is
|
||||
/// Represents a unitary time-evolution operator.
|
||||
///
|
||||
/// The first parameter is
|
||||
/// is duration of time-evolution, and the second parameter is the qubit
|
||||
/// register acted upon by the unitary.
|
||||
newtype EvolutionUnitary = ((Double, Qubit[]) => Unit : Adjoint, Controlled);
|
||||
|
||||
/// # Summary
|
||||
/// Represents a set of gates that can be readily implemented and used
|
||||
/// to implement simulation algorithms. Elements in the set are indexed
|
||||
/// to implement simulation algorithms.
|
||||
///
|
||||
/// Elements in the set are indexed
|
||||
/// by a <xref:microsoft.quantum.canon.generatorindex>,
|
||||
/// and each set is described by a function
|
||||
/// from `GeneratorIndex` to <xref:microsoft.quantum.canon.evolutionunitary>,
|
||||
|
@ -76,18 +84,21 @@ namespace Microsoft.Quantum.Canon
|
|||
/// # Summary
|
||||
/// Represents a dynamical generator as a set of simulatable gates and
|
||||
/// an expansion in terms of that basis.
|
||||
/// Last parameter for number of terms
|
||||
///
|
||||
/// Last parameter for number of terms.
|
||||
newtype EvolutionGenerator = (EvolutionSet, GeneratorSystem);
|
||||
|
||||
/// # Summary
|
||||
/// Represents a time-dependent dynamical generator. The `Double`
|
||||
/// Represents a time-dependent dynamical generator.
|
||||
///
|
||||
/// The `Double`
|
||||
/// parameter is a schedule in $[0, 1]$.
|
||||
newtype EvolutionSchedule = (EvolutionSet, (Double -> GeneratorSystem));
|
||||
|
||||
|
||||
/// # Summary
|
||||
/// Returns a generator index consistent with the
|
||||
/// Hamiltonian $H = 0$.
|
||||
/// Returns a generator index consistent with the zero
|
||||
/// Hamiltonian, `H = 0`, which corresponds to the identity evolution operation.
|
||||
///
|
||||
/// # Input
|
||||
/// ## idxTerm
|
||||
|
@ -104,8 +115,8 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
|
||||
/// # Summary
|
||||
/// Returns a generator system consistent with the
|
||||
/// Hamiltonian $H = 0$.
|
||||
/// Returns a generator system consistent with the zero
|
||||
/// Hamiltonian `H = 0`, which corresponds to the identity evolution operation.
|
||||
///
|
||||
/// # Output
|
||||
/// A generator system representing evolution under the Hamiltonian
|
||||
|
@ -118,7 +129,7 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
/// # Summary
|
||||
/// Returns a generator system consistent with the
|
||||
/// Hamiltonian $H(s) = 0$, where $s$ is a schedule parameter.
|
||||
/// Hamiltonian `H(s) = 0`, where `s` is a schedule parameter.
|
||||
///
|
||||
/// # Input
|
||||
/// ## schedule
|
||||
|
@ -136,7 +147,7 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
/// # Summary
|
||||
/// Returns a time-dependent generator system consistent with the
|
||||
/// Hamiltonian $H(s) = 0$.
|
||||
/// Hamiltonian `H(s) = 0`.
|
||||
///
|
||||
/// # Output
|
||||
/// A time dependent generator system representing evolution under the Hamiltonian
|
||||
|
@ -203,7 +214,7 @@ namespace Microsoft.Quantum.Canon
|
|||
///
|
||||
/// # Example
|
||||
/// ```qsharp
|
||||
/// let gen = GeneratorIndex(([1,2,3],[coeff]),[1;2;3);
|
||||
/// let gen = GeneratorIndex(([1,2,3],[coeff]),[1,2,3]);
|
||||
/// let ((idxPaulis, idxDoubles), idxQubits) = MultiplyGeneratorIndex(multipler, gen);
|
||||
/// // idxDoubles[0] == multipler * coeff;
|
||||
/// ```
|
||||
|
@ -254,7 +265,7 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
|
||||
/// # Summary
|
||||
/// Adds two `GeneratorSystems` to create a new GeneratorSystem.
|
||||
/// Adds two `GeneratorSystem`s to create a new `GeneratorSystem`.
|
||||
///
|
||||
/// # Remarks
|
||||
/// This is an intermediate step and should not be called.
|
||||
|
@ -272,7 +283,7 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
|
||||
/// # Summary
|
||||
/// Adds two `GeneratorSystems` to create a new GeneratorSystem.
|
||||
/// Adds two `GeneratorSystem`s to create a new `GeneratorSystem`.
|
||||
///
|
||||
/// # Input
|
||||
/// ## generatorSystemA
|
||||
|
@ -297,11 +308,11 @@ namespace Microsoft.Quantum.Canon
|
|||
}
|
||||
|
||||
|
||||
/// Create description of system that interpolates between two GeneratorSystems based on a schedule parameter in [0,1]
|
||||
///
|
||||
// Create description of system that interpolates between two GeneratorSystems based on a schedule parameter in [0,1]
|
||||
//
|
||||
/// # Summary
|
||||
/// Linearly interpolates between two `GeneratorSystems` according to a
|
||||
/// schedule parameter $s\in[0,1]$.
|
||||
/// schedule parameter `s` btween 0 and 1 (inclusive).
|
||||
///
|
||||
/// # Input
|
||||
/// ## schedule
|
||||
|
@ -328,8 +339,7 @@ namespace Microsoft.Quantum.Canon
|
|||
|
||||
/// # Summary
|
||||
/// Returns a `TimeDependentGeneratorSystem` representing the linear
|
||||
/// interpolation between two `GeneratorSystems` according to a
|
||||
/// schedule parameter $s\in[0,1]$.
|
||||
/// interpolation between two `GeneratorSystem`s.
|
||||
///
|
||||
/// # Input
|
||||
/// ## generatorSystemStart
|
||||
|
@ -351,7 +361,7 @@ namespace Microsoft.Quantum.Canon
|
|||
}
|
||||
|
||||
/// # Summary
|
||||
/// Adds multiple `GeneratorSystems` to create a new GeneratorSystem.
|
||||
/// Adds multiple `GeneratorSystem`s to create a new GeneratorSystem.
|
||||
///
|
||||
/// # Input
|
||||
/// ## generatorSystems
|
||||
|
|
Загрузка…
Ссылка в новой задаче