Class definition for performing quantum forward and inverse Fourier transforms.
More...
#include <qft.hpp>
|
static void | applyQFT (SimulatorType &qSim, const unsigned int minIdx, const unsigned int maxIdx) |
| Applies the forward QFT on the given register. More...
|
|
static void | applyIQFT (SimulatorType &qSim, const unsigned int minIdx, const unsigned int maxIdx) |
| Applies the inverse QFT on the given register. More...
|
|
template<class SimulatorType>
class QNLP::QFT< SimulatorType >
Class definition for performing quantum forward and inverse Fourier transforms.
- Template Parameters
-
SimulatorType | Class Simulator type |
Definition at line 23 of file qft.hpp.
◆ applyIQFT()
template<class SimulatorType >
static void QNLP::QFT< SimulatorType >::applyIQFT |
( |
SimulatorType & |
qSim, |
|
|
const unsigned int |
minIdx, |
|
|
const unsigned int |
maxIdx |
|
) |
| |
|
inlinestatic |
Applies the inverse QFT on the given register.
- Parameters
-
qSim | The qubit register |
minIdx | the lower-bounded index in the register to transform |
maxIdx | the upper-bounded index in the register to transform |
Definition at line 55 of file qft.hpp.
57 qSim.InvertRegister(minIdx, maxIdx);
60 for(
int i = minIdx; i <= (int) maxIdx; i++){
63 for(
int j = minIdx; j < i; j++){
64 theta = -2.0*M_PI / (std::size_t) (0b1<<(1+(i-j)));
65 qSim.applyGateCPhaseShift(theta, j, i);
◆ applyQFT()
template<class SimulatorType >
static void QNLP::QFT< SimulatorType >::applyQFT |
( |
SimulatorType & |
qSim, |
|
|
const unsigned int |
minIdx, |
|
|
const unsigned int |
maxIdx |
|
) |
| |
|
inlinestatic |
Applies the forward QFT on the given register.
- Parameters
-
qSim | The qubit register |
minIdx | the lower-bounded index in the register to transform |
maxIdx | the upper-bounded index in the register to transform |
Definition at line 32 of file qft.hpp.
36 for(
int i = maxIdx; i >= (int) minIdx; i--){
40 for(
int j = i-1; j >= (int) minIdx; j--){
41 theta = 2.0*M_PI / (std::size_t) (0b1<<(1+(i-j)));
42 qSim.applyGateCPhaseShift(theta, j, i);
45 qSim.InvertRegister(minIdx, maxIdx);
The documentation for this class was generated from the following file:
- /Users/mlxd/Desktop/intel-qnlp-rc2/modules/gate_ops/qft/qft.hpp