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

Method get_data

runtime/cudaq/operators/matrix.cpp:77–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77cudaq::complex_matrix::value_type *
78cudaq::complex_matrix::get_data(cudaq::complex_matrix::order order) {
79 if (order != this->internal_order) {
80 auto new_data =
81 new cudaq::complex_matrix::value_type[this->rows() * this->cols()];
82 for (std::size_t i = 0; i < this->rows(); i++)
83 for (std::size_t j = 0; j < this->cols(); j++)
84 access(new_data, this->dimensions, i, j, order) =
85 access(this->data, this->dimensions, i, j, this->internal_order);
86 swap(new_data);
87 this->internal_order = order;
88 }
89 return this->data;
90}
91
92const cudaq::complex_matrix::EigenMatrix
93cudaq::complex_matrix::as_eigen() const {

Callers 6

bindComplexMatrixFunction · 0.80
cmat_to_numpyFunction · 0.80
TESTFunction · 0.80
apply_gate_in_placeFunction · 0.80
createFromDataMethod · 0.80
createFromDataMethod · 0.80

Calls 3

rowsMethod · 0.95
colsMethod · 0.95
swapFunction · 0.50

Tested by

no test coverage detected