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

Function TEST

unittests/operators/spin_op.cpp:13–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <gtest/gtest.h>
12
13TEST(OperatorExpressions, checkSpinOpsUnary) {
14 auto op = cudaq::spin_op::x(0);
15 utils::checkEqual((+op).to_matrix(), utils::PauliX_matrix());
16 utils::checkEqual((-op).to_matrix(), -1.0 * utils::PauliX_matrix());
17 utils::checkEqual(op.to_matrix(), utils::PauliX_matrix());
18}
19
20TEST(OperatorExpressions, checkSpinOpsConstruction) {
21 auto prod = cudaq::spin_op::identity();

Callers

nothing calls this directly

Calls 15

checkEqualFunction · 0.85
PauliX_matrixFunction · 0.85
identityFunction · 0.85
complex_matrixClass · 0.85
id_matrixFunction · 0.85
PauliZ_matrixFunction · 0.85
PauliY_matrixFunction · 0.85
minusFunction · 0.85
scalar_operatorClass · 0.85
kroneckerFunction · 0.85
num_opsMethod · 0.80
annihilate_matrixFunction · 0.70

Tested by

no test coverage detected