From: miha-q <> Date: Sat, 3 Aug 2024 23:53:42 +0000 (-0400) Subject: Sat Aug 3 07:53:42 PM EDT 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=89a0525d117e39e651837b2e81f5fd0e9400ff08;p=QAnsel.git Sat Aug 3 07:53:42 PM EDT 2024 --- diff --git a/examples/ghz.txt b/examples/ghz.txt index 1736457..5872d9e 100644 --- a/examples/ghz.txt +++ b/examples/ghz.txt @@ -1,9 +1,4 @@ -qreg q[3]; -h q[0]; -cx q[0], q[1]; -sdg q[1]; -sdg q[2]; -h q[0]; -h q[1]; -h q[2]; -sample q; \ No newline at end of file +qreg q[1]; +rx(pi/3) q[0]; + +born q; \ No newline at end of file diff --git a/src/bytecode.c b/src/bytecode.c index 4cf466f..e892ccb 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1489,9 +1489,9 @@ void qansel_run(QAnselContext* ctx, unsigned char* program, int programSize, int switch (instr) { case QANSEL_INSTRUCTION_RX: - f0 = M_PI / 2; + f0 = qansel_get_float(program, PC + 2); f1 = -M_PI / 2; - f2 = qansel_get_float(program, PC + 2) - (M_PI / 2); + f2 = M_PI / 2; break; case QANSEL_INSTRUCTION_RY: case QANSEL_INSTRUCTION_U1: @@ -1554,6 +1554,7 @@ void qansel_run(QAnselContext* ctx, unsigned char* program, int programSize, int case QANSEL_INSTRUCTION_BORN: a0 = program[PC + 1]; qansel_born(ctx, &stateVector, PC, qubitCount, a0, 0); + break; case QANSEL_INSTRUCTION_BSAMPLE: a0 = program[PC + 1]; qansel_born(ctx, &stateVector, PC, qubitCount, a0, 1); diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000..e33686d Binary files /dev/null and b/src/favicon.ico differ diff --git a/src/index.html b/src/index.html index 2584723..a7bc52c 100644 --- a/src/index.html +++ b/src/index.html @@ -1,4 +1,6 @@ + + QAnsel @@ -345,7 +347,7 @@ { if (maxC >= 0) { - ret = "creg c[" + (maxC + 1) + "];\n" + ret; + ret = "creg c[" + (maxC) + "];\n" + ret; } if (maxQ >= 0) { @@ -729,6 +731,17 @@ createBlocker(); var key = localStorage.getItem("apikey"); key = key ? key : ""; + try + { + key = atob(key); + } + catch + { + $("#blocker-div")[0].remove(); + $("#blocker-img")[0].remove(); + errorModal("Please click the gear icon and input your API key."); + return; + } if (key.split(":").length != 3) { $("#blocker-div")[0].remove(); diff --git a/src/openqasm.c b/src/openqasm.c index 5104e0d..3366d77 100644 --- a/src/openqasm.c +++ b/src/openqasm.c @@ -200,7 +200,6 @@ int qansel_parse_float(char* str, float* returnFloat) exit(1); } regfree(®ex); - return 1; } diff --git a/src/src.zip b/src/src.zip index c628e38..42d78fd 100644 Binary files a/src/src.zip and b/src/src.zip differ