MCPcopy Create free account
hub / github.com/davisking/dlib / compute_state_element

Method compute_state_element

dlib/quantum_computing/quantum_computing.h:330–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329 template <typename exp>
330 qc_scalar_type compute_state_element (
331 const matrix_exp<exp>& reg,
332 long row_idx
333 ) const
334 {
335 // make sure requires clause is not broken
336 DLIB_ASSERT(reg.nr() == dims && reg.nc() == 1 &&
337 0 <= row_idx && row_idx < dims,
338 "\tqc_scalar_type gate_exp::compute_state_element(reg,row_idx)"
339 << "\n\tinvalid arguments to this function"
340 << "\n\treg.nr(): " << reg.nr()
341 << "\n\treg.nc(): " << reg.nc()
342 << "\n\tdims: " << dims
343 << "\n\trow_idx: " << row_idx
344 << "\n\tthis: " << this
345 );
346
347
348 return this->exp.compute_state_element(reg,row_idx);
349 }
350
351 const T& ref() const { return exp; }
352

Callers

nothing calls this directly

Calls 3

nrMethod · 0.45
ncMethod · 0.45
compute_state_elementMethod · 0.45

Tested by

no test coverage detected