MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / TEST

Function TEST

unittests/utils/Matrix.cpp:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31TEST(Tensor, initialization) {
32 {
33 cudaq::complex_matrix m0;
34 string_equal(m0.to_string(), "\n");
35 }
36 {
37 cudaq::complex_matrix m1({1., 0., 0., 1.});
38 string_equal(m1.to_string(), "(1,0) (0,0)\n(0,0) (1,0)\n");
39 }
40 {
41 cudaq::complex_matrix m1({1., 2., 3., 4., 5., 6.}, {2, 3});
42 string_equal(m1.to_string(), "(1,0) (2,0) (3,0)\n(4,0) (5,0) (6,0)\n");
43 }
44 {
45 cudaq::complex_matrix m1({1., 2., 3., 4., 5., 6.}, {2, 3},
46 cudaq::complex_matrix::order::column_major);
47 string_equal(m1.to_string(), "(1,0) (3,0) (5,0)\n(2,0) (4,0) (6,0)\n");
48 }
49}
50
51TEST(Tensor, initializationError) {
52 {

Callers

nothing calls this directly

Calls 12

string_equalFunction · 0.85
kroneckerFunction · 0.85
cbeginMethod · 0.80
cendMethod · 0.80
exponentialMethod · 0.80
get_dataMethod · 0.80
eigenvaluesMethod · 0.80
to_stringMethod · 0.45
strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected