40 TEST_CASE(
"DiracMatrixComputeOMPTarget_different_batch_sizes",
"[wavefunction][fermion]")
44 std::vector<double>
A{2, 5, 8, 7, 5, 2, 2, 8, 7, 5, 6, 6, 5, 4, 4, 8};
53 std::complex<double> log_value;
60 double invA[16]{-0.08247423, -0.26804124, 0.26804124, 0.05154639, 0.18556701, -0.89690722, 0.39690722, 0.13402062,
61 0.24742268, -0.19587629, 0.19587629, -0.15463918, -0.29896907, 1.27835052, -0.77835052, 0.06185567};
84 CHECK(
log_values[0] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
85 CHECK(
log_values[1] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
108 CHECK(
log_values[0] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
109 CHECK(
log_values[1] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
110 CHECK(
log_values[2] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
113 TEST_CASE(
"DiracMatrixComputeOMPTarget_large_determinants_against_legacy",
"[wavefunction][fermion]")
127 for (
int i = 0; i <
n; ++i)
128 for (
int j = 0; j <
n; ++j)
129 mat_a(i, j) = mat_spd(i, j);
138 for (
int i = 0; i <
n; ++i)
139 for (
int j = 0; j <
n; ++j)
140 mat_a2(i, j) = mat_spd2(i, j);
157 std::complex<double> det_log_value;
helper functions for EinsplineSetBuilder
class to compute matrix inversion and the log value of determinant of a batch of DiracMatrixes.
Vector< T, PinnedDualAllocator< T > > OffloadPinnedVector
std::vector< StdComp, CUDAHostAllocator< StdComp > > log_values(batch_size)
void mw_invertTranspose(compute::Queue< PL > &resource_ignored, const RefVector< const OffloadPinnedMatrix< TMAT >> &a_mats, const RefVector< OffloadPinnedMatrix< TMAT >> &inv_a_mats, OffloadPinnedVector< LogValue > &log_values)
This covers both mixed and Full precision case.
TEST_CASE("complex_helper", "[type_traits]")
CHECKED_ELSE(check_matrix_result.result)
void resize(size_type n, size_type m)
Resize the container.
Catch::Detail::LogComplexApprox LogComplexApprox
void makeRngSpdMatrix(testing::RandomForTest< RngValueType< T >> &rng, Matrix< T > &mat_spd)
helper class to compute matrix inversion and the log value of determinant
std::enable_if_t< std::is_same< VALUE_FP, TMAT >::value > invert_transpose(HandleResource &resource, const OffloadPinnedMatrix< TMAT > &a_mat, OffloadPinnedMatrix< TMAT > &inv_a_mat, LogValue &log_value)
compute the inverse of the transpose of matrix A and its determinant value in log when VALUE_FP and T...
std::vector< std::reference_wrapper< T > > RefVector
Declaraton of Vector<T,Alloc> Manage memory through Alloc directly and allow referencing an existing ...
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Declaration of WaveFunctionComponent.
OMPallocator< T, PinnedAlignedAllocator< T > > OffloadPinnedAllocator
Matrix< T, PinnedDualAllocator< T > > OffloadPinnedMatrix
std::enable_if_t< std::is_same< T_FP, TMAT >::value > invert_transpose(const Matrix< TMAT, ALLOC1 > &amat, Matrix< TMAT, ALLOC2 > &invMat, std::complex< TREAL > &LogDet)
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT ...
Functor to provide scope for rng when making SpdMatrix for testing.