MCPcopy Create free account
hub / github.com/davisking/dlib / operator()

Method operator()

examples/quantum_computing_ex.cpp:154–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 static const long dims = gate_traits<uf_gate>::dims;
153
154 const qc_scalar_type operator() (long r, long c) const
155 {
156 unsigned long output = c;
157 // if the input control bit is set
158 if (is_key(output>>1))
159 {
160 output = output^0x1;
161 }
162
163 if ((unsigned long)r == output)
164 return 1;
165 else
166 return 0;
167 }
168
169 template <typename exp>
170 qc_scalar_type compute_state_element (

Callers

nothing calls this directly

Calls 1

is_keyFunction · 0.85

Tested by

no test coverage detected