QNLP
v1.0
|
Class definition for implementing the Hamming distance routine along with controlled Y rotations to encode the Hamming distance into the states' amplitudes. More...
#include <hamming.hpp>
Public Member Functions | |
HammingDistance ()=delete | |
Construct a new Hamming Distance Rot Y object (disabled) More... | |
HammingDistance (const std::size_t len_bin_pattern_) | |
Construct a new Hamming Distance Rot Y object. More... | |
~HammingDistance () | |
Destroy the Hamming Distance Rot Y object. More... | |
Static Public Member Functions | |
static void | computeHammingDistanceRotY (SimulatorType &qSim, const std::vector< std::size_t > ®_memory, const std::vector< std::size_t > ®_auxiliary, std::size_t len_bin_pattern) |
Computes Hamming Distance; adjusts each state's amplitude proportional to the Hamming distance between the state's training pattern and the test pattern using rotations about y for each mattern qubit. More... | |
static void | computeHammingDistanceOverwriteAux (SimulatorType &qSim, const std::vector< std::size_t > ®_memory, const std::vector< std::size_t > ®_auxiliary) |
Computes Hamming Distance; Overwrites the pattern in reg_auxiliary to track bit differences from reg_memory. More... | |
Private Types | |
using | Mat2x2Type = decltype(std::declval< SimulatorType >().getGateX()) |
Private Attributes | |
std::size_t | len_bin_pattern |
Class definition for implementing the Hamming distance routine along with controlled Y rotations to encode the Hamming distance into the states' amplitudes.
SimulatorType | Class simulator type |
Definition at line 26 of file hamming.hpp.
|
private |
Definition at line 29 of file hamming.hpp.
|
delete |
Construct a new Hamming Distance Rot Y object (disabled)
|
inline |
Construct a new Hamming Distance Rot Y object.
len_bin_pattern_ | Length of binary string which the Hamming distance is to be computed upon |
Definition at line 45 of file hamming.hpp.
References QNLP::HammingDistance< SimulatorType >::len_bin_pattern.
|
inline |
|
inlinestatic |
Computes Hamming Distance; Overwrites the pattern in reg_auxiliary to track bit differences from reg_memory.
qSim | Quantum simulator instance. |
reg_memory | A vector containing the indices of the qubits of the memory register. |
reg_auxiliary | A vector containing the indices of the qubits of the auxiliary register. |
Definition at line 102 of file hamming.hpp.
References QNLP_Python_MPI::reg_auxiliary, and QNLP_EndToEnd_MPI::reg_memory.
Referenced by QNLP::SimulatorGeneral< IntelSimulator >::applyHammingDistanceOverwrite().
|
inlinestatic |
Computes Hamming Distance; adjusts each state's amplitude proportional to the Hamming distance between the state's training pattern and the test pattern using rotations about y for each mattern qubit.
qSim | Quantum simulator instance. |
reg_memory | A vector containing the indices of the qubits of the memory register. |
reg_auxiliary | A vector containing the indices of the qubits of the auxiliary register. |
len_bin_pattern | length of binary pattern ie length of memory register. |
Definition at line 64 of file hamming.hpp.
References QNLP::HammingDistance< SimulatorType >::len_bin_pattern, QNLP_Python_MPI::len_reg_auxiliary, QNLP_Python_MPI::reg_auxiliary, and QNLP_EndToEnd_MPI::reg_memory.
Referenced by QNLP::SimulatorGeneral< IntelSimulator >::applyHammingDistanceRotY().
|
private |
Definition at line 31 of file hamming.hpp.
Referenced by QNLP::HammingDistance< SimulatorType >::computeHammingDistanceRotY(), and QNLP::HammingDistance< SimulatorType >::HammingDistance().