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