MultiplyGeneratorIndex function
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Simulation
Package: Microsoft.Quantum.Standard
Multiplies the coefficient in a GeneratorIndex
.
function MultiplyGeneratorIndex (multiplier : Double, generatorIndex : Microsoft.Quantum.Simulation.GeneratorIndex) : Microsoft.Quantum.Simulation.GeneratorIndex
Input
multiplier : Double
The multiplier on the coefficient.
generatorIndex : GeneratorIndex
The GeneratorIndex
to be multiplied.
Output : GeneratorIndex
A GeneratorIndex
representing a term with coefficient a factor
multiplier
larger.
Example
let gen = GeneratorIndex(([1,2,3],[coeff]),[1,2,3]);
let ((idxPaulis, idxDoubles), idxQubits) = MultiplyGeneratorIndex(multiplier, gen);
// idxDoubles[0] == multiplier * coeff;
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for