| 160 | |
| 161 | |
| 162 | extern "C" SuperOp createSuperOp(int numQubits) { |
| 163 | validate_envIsInit(__func__); |
| 164 | validate_newSuperOpParams(numQubits, __func__); |
| 165 | |
| 166 | SuperOp out = allocSuperOp(numQubits); // fields may be or contain nullptr if failed |
| 167 | |
| 168 | // free all memory before we throw validation errors to avoid leaks |
| 169 | freeAllMemoryIfAnyAllocsFailed(out); |
| 170 | validate_newSuperOpAllocs(out, __func__); |
| 171 | |
| 172 | return out; |
| 173 | } |
| 174 | |
| 175 | |
| 176 | extern "C" KrausMap createKrausMap(int numQubits, int numOperators) { |
no test coverage detected