Module circuits

Source
Expand description

Commonly used quantum circuits.

You can easily use basic operations such as addition and subtraction and major quantum circuits such as quantum Fourier transform.

Functions§

add_const
A quantum circuit that directly overwrites the input qubit with the result of adding the value represented by the qubit and a constant.
add_const_2_power
|0⟩|b⟩ → |overflow⟩|b + 2^m⟩
cmm_const
A circuit that multiplies input qubits by a constant and stores the result of modular operation using the constant in the input qubit.
full_adder_bit
|a⟩|b⟩|C⟩|0⟩ → |a⟩|a+b+c⟩|C⟩|C_out⟩
full_adder_nbits
|a⟩|b⟩|0⟩ → |a⟩|a+b⟩|0⟩
half_adder_bit
Circuit that performs half addition on qubit
inv_qft
Circuit that performs inverse quantum Fourier transform
me_const
A circuit that outputs the result of modular operation with n_const after raising a_const to the power of the input qubit.
mod_add
A quantum circuit that stores the result of addition and modular operation in one input bit.
mod_add_const
A quantum circuit that adds constants and multiplies modular operations using constants, and stores the result in one input bit.
overflow_qadd_const
Add const_a to b and store the result in b. Store overflow results
overflow_qadd_const_2_power
Add the input 2 to the power of m to b and store the result in b. Store overflow results
overflow_qsub_const
Substract const_a to b and store the result in b. Store overflow results
qft
Circuit that performs quantum Fourier transform
sub_const
|0⟩|b⟩|0⟩ → |sign⟩|b + a⟩|0⟩
substract_nbits
swap
Swap Q-bit between index of a_in and b_in
wrapping_qadd_const
Wrapping add const_a to b and store the result in b.
wrapping_qadd_const_2_power
Wrapping add the input 2 to the power of m to b and store the result in b. |b⟩ → |b + 2^m⟩
wrapping_qsub_const
Wrapping substract const_a to b and store the result in b.