[Qmod core-library function]Adds two quantum variables representing integers (signed or unsigned), storing the
result in the second variable (in-place):∣left⟩∣right⟩↦∣left⟩(right+left)mod2right.size⟩Parameters:
Name
Type
Description
Default
left
Const[QArray]
The out-of-place argument for the addition.
required
extend_left
CBool
Whether to sign-extend the left argument.
required
right
QArray
The in-place argument for the addition, holds the final result.
[Qmod core-library function]Adds an integer constant to a quantum variable representing an integer (signed or
unsigned):∣right⟩↦(right+left)mod2right.size⟩Parameters:
Name
Type
Description
Default
left
CInt
The constant argument for the addition.
required
right
QArray
The quantum argument for the addition, holds the final result.
[Qmod core-library function]Multiplies two quantum variables representing integers (signed or unsigned) into the
result variable which is assumed to start in the ∣0⟩ state.If trim_result_lsb is False, applies the transformation:∣left⟩∣right⟩∣0⟩↦∣left⟩∣right⟩(left⋅right)mod2result.size⟩If trim_result_lsb is True, the function avoids computing the result’s LSB and
applies the transformation:∣left⟩∣right⟩∣0⟩↦∣left⟩∣right⟩(left⋅right)≫1mod2result.size⟩Parameters:
Name
Type
Description
Default
left
Const[QArray]
The first argument for the multiplication.
required
extend_left
CBool
Whether to sign-extend the left argument.
required
right
Const[QArray]
The second argument for the multiplication.
required
extend_right
CBool
Whether to sign-extend the right argument.
required
result
QArray
The quantum variable to hold the multiplication result.
[Qmod core-library function]Multiplies a quantum variable representing an integer (signed or unsigned) with a
constant, into the result variable which is assumed to start in the ∣0⟩ state.If trim_result_lsb is False, applies the transformation:∣right⟩∣0⟩↦∣right⟩(left⋅right)mod2result.size⟩If trim_result_lsb is True, the function avoids computing the result’s LSB and
applies the transformation:∣right⟩∣0⟩↦∣right⟩(left⋅right)≫1mod2result.size⟩Parameters:
Name
Type
Description
Default
left
CInt
The constant argument for the multiplication.
required
right
Const[QArray]
The variable argument for the multiplication.
required
extend_right
CBool
Whether to sign-extend the right argument.
required
result
QArray
The quantum variable to hold the multiplication result.
[Qmod core-library function]Squares a quantum variable representing an integer (signed or unsigned), into
the result variable which is assumed to start in the ∣0⟩ state.If trim_result_lsb is False, applies the transformation:∣arg⟩∣0⟩↦∣arg⟩(arg2)mod2result.size⟩If trim_result_lsb is True, the function avoids computing the result’s LSB and
applies the transformation:∣arg⟩∣0⟩↦∣arg⟩(arg2)≫1mod2result.size⟩Parameters: