diff options
| author | hachem <im@hachem.wtf> | 2026-09-06 21:06:02 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-06 21:06:02 +0200 |
| commit | baecb524fb2b8162409d86d84cdddbd20b930c50 (patch) | |
| tree | 88cbc334f2ce2c3b975d97c5ca584ad5beab0b29 /tester | |
| parent | 081fc18575be18ddedf603638793152d5ddc83b6 (diff) | |
add: classical bits and registers
Diffstat (limited to 'tester')
| -rw-r--r-- | tester/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tester/main.c b/tester/main.c index e401288..13c9257 100644 --- a/tester/main.c +++ b/tester/main.c @@ -1,5 +1,6 @@ #include <stdio.h> +#include "core/classical_components.h" #include "core/custom_gate.h" #include "core/gates.h" #include "core/quantum_components.h" @@ -117,5 +118,15 @@ int main(void) psi_free_quantum_gate(&bell_gate); psi_free_quantum_register(®2); + const char *cnames[] = { "c0", "c1" }; + struct PsiClassicalRegister creg = psi_new_classical_register("c", cnames, 2); + creg.bits[1].state = true; + + printf("creg = %s=%d %s=%d\n", + creg.bits[0].name, creg.bits[0].state, + creg.bits[1].name, creg.bits[1].state); + + psi_free_classical_register(&creg); + return 0; } |
