QNLP
v1.0
|
Class definition for bit-wise summation and subtraction of qubits. More...
#include <arithmetic.hpp>
Public Types | |
using | CST = const std::size_t |
Static Public Member Functions | |
static void | sum_reg (SimulatorType &qSim, CST r1_min, CST r1_max, CST r2_min, CST r2_max) |
Implements |r1>|r2> -> |r1>|r1+r2>. Required bits to represent |r1+r2> should be available prior to calling, or overflow will occur. More... | |
static void | sub_reg (SimulatorType &qReg, const unsigned int r1_min, const unsigned int r1_max, const unsigned int r2_min, const unsigned int r2_max) |
Implements |r1>|r2> -> |r1>|r1-r2>. If r1 < r2 the state will underflow, with the subtraction continuing from |11..1>. More... | |
Class definition for bit-wise summation and subtraction of qubits.
SimulatorType |
Definition at line 22 of file arithmetic.hpp.
using QNLP::Arithmetic< SimulatorType >::CST = const std::size_t |
Definition at line 24 of file arithmetic.hpp.
|
inlinestatic |
Implements |r1>|r2> -> |r1>|r1-r2>. If r1 < r2 the state will underflow, with the subtraction continuing from |11..1>.
qReg | The quantum register holding the bitstring to remain unmodified |
r1_min | The lowest bounded r1 index to perform Fourier transform on. |
r1_max | The highest bounded r1 index to perform Fourier transform on. |
r2_min | The lowest bounded r2 index to perform Fourier transform on. |
r2_max | The highest bounded r2 index to perform Fourier transform on. |
Definition at line 64 of file arithmetic.hpp.
References QNLP::Arithmetic< SimulatorType >::sum_reg().
Referenced by TEST_CASE().
|
inlinestatic |
Implements |r1>|r2> -> |r1>|r1+r2>. Required bits to represent |r1+r2> should be available prior to calling, or overflow will occur.
qReg | The quantum register holding the bitstrings r1,r2 |
r1_min | The lowest bounded r1 index to perform Fourier transform on. |
r1_max | The highest bounded r1 index to perform Fourier transform on. |
r2_min | The lowest bounded r2 index to perform Fourier transform on. |
r2_max | The highest bounded r2 index to perform Fourier transform on. |
Definition at line 34 of file arithmetic.hpp.
Referenced by QNLP::Arithmetic< SimulatorType >::sub_reg(), and TEST_CASE().