Skip to content

Commit

Permalink
Updates for 0.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Classiq Bot committed Oct 31, 2023
1 parent 472a831 commit d5fedfa
Show file tree
Hide file tree
Showing 164 changed files with 757 additions and 930 deletions.
12 changes: 2 additions & 10 deletions algorithms/algebraic/hidden_shift/hidden_shift_complex.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 886692080,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 886692080
},
"kind": "synthesis",
"functions": [
Expand All @@ -25,9 +19,7 @@
"size": {
"expr": "16"
},
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
16 changes: 3 additions & 13 deletions algorithms/algebraic/hidden_shift/hidden_shift_no_dual.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 1705505444,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 1705505444
},
"kind": "synthesis",
"functions": [
Expand All @@ -25,19 +19,15 @@
"size": {
"expr": "16"
},
"is_signed": {
"expr": "False"
}
"is_signed": false
},
"b": {
"name": "b",
"direction": "output",
"size": {
"expr": "1"
},
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
12 changes: 2 additions & 10 deletions algorithms/algebraic/hidden_shift/hidden_shift_simple.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 2374102167,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 2374102167
},
"kind": "synthesis",
"functions": [
Expand All @@ -25,9 +19,7 @@
"size": {
"expr": "4"
},
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
8 changes: 4 additions & 4 deletions algorithms/algebraic/shor/shor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"\n",
"from classiq import (\n",
" H,\n",
" OutputQVar,\n",
" Output,\n",
" QFunc,\n",
" QParam,\n",
" QVar,\n",
Expand Down Expand Up @@ -172,8 +172,8 @@
"source": [
"@QFunc\n",
"def period_finding(\n",
" qv_counting: OutputQVar[num_counting_qubits],\n",
" qv_auxilliary: OutputQVar[num_auxilliary_qubits],\n",
" qv_counting: Output[QVar[num_counting_qubits]],\n",
" qv_auxilliary: Output[QVar[num_auxilliary_qubits]],\n",
") -> None:\n",
" # start with a uniform superposition in the counting register\n",
" allocate(num_counting_qubits, qv_counting)\n",
Expand Down Expand Up @@ -233,7 +233,7 @@
"outputs": [],
"source": [
"@QFunc\n",
"def main(qv_counting: OutputQVar[num_counting_qubits]) -> None:\n",
"def main(qv_counting: Output[QVar[num_counting_qubits]]) -> None:\n",
" qv_auxilliary = QVar(\"qv_auxilliary\")\n",
" period_finding(qv_counting, qv_auxilliary)\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions algorithms/algebraic/shor/shor.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
},
"operand_declarations": {},
"positional_param_declarations": [],
"positional_arg_declarations": [],
"body": [
{
"function": "unitary",
Expand Down Expand Up @@ -59,7 +59,7 @@
}
},
"operand_declarations": {},
"positional_param_declarations": [],
"positional_arg_declarations": [],
"body": [
{
"function": "allocate",
Expand Down Expand Up @@ -308,7 +308,7 @@
}
},
"operand_declarations": {},
"positional_param_declarations": [],
"positional_arg_declarations": [],
"body": [
{
"function": "period_finding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
"id": "2bf3970d",
"metadata": {},
"source": [
"The counts for the phases stored in the `phase_result` are given in `res.counts_of_output('phase_result')`"
"The counts for the phases stored in the `phase_result` are given in `res.parsed_counts`"
]
},
{
Expand All @@ -742,7 +742,7 @@
},
"outputs": [],
"source": [
"phases_counts = res.counts_of_output(\"phase_result\")"
"phases_counts = res.parsed_counts"
]
},
{
Expand All @@ -764,8 +764,8 @@
"source": [
"## mapping between register string to phases\n",
"phases_counts = dict(\n",
" (int(x[::-1], 2) / 2**n_qpe, counts)\n",
" for x, counts in res.counts_of_output(\"phase_result\").items()\n",
" (sampled_state.state[\"phase_result\"] / 2**n_qpe, sampled_state.shots)\n",
" for sampled_state in res.parsed_counts\n",
")"
]
},
Expand Down Expand Up @@ -831,7 +831,7 @@
"\n",
"<a name='LPR'>[LPR]</a>: [Classiq's LinearPauliRotations built-in function](https://docs.classiq.io/latest/user-guide/builtin-functions/linear-pauli-rotations/)\n",
"\n",
"<a name='QPE'>[QPE]</a>: [Classiq's QuantumPhaseEstimation built-in function](https://docs.classiq.io/latest/user-guide/builtin-functions/qpe/)"
"<a name='QPE'>[QPE]</a>: [Classiq's QuantumPhaseEstimation built-in function](https://docs.classiq.io/latest/user-guide/builtin-functions/qpe/)\n"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 4139756191,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 4139756191
},
"kind": "synthesis",
"functions": [
Expand Down Expand Up @@ -880,9 +874,7 @@
"size": {
"expr": "3"
},
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
12 changes: 2 additions & 10 deletions algorithms/deutsch_josza/complex_deutsch_jozsa.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 1419268166,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 1419268166
},
"kind": "synthesis",
"functions": [
Expand All @@ -25,9 +19,7 @@
"expr": "3"
},
"direction": "output",
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
12 changes: 2 additions & 10 deletions algorithms/deutsch_josza/simple_deutsch_jozsa.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
"types": [],
"constants": [],
"classical_execution_code": "\nresult = sample({})\nsave({'result': result})\n",
"classical_functions": [],
"execution_preferences": {
"amplitude_amplification": {
"iterations": []
},
"random_seed": 3810723254,
"backend_preferences": {
"backend_service_provider": "IBM Quantum",
"backend_name": "aer_simulator",
"provider": {}
}
"random_seed": 3810723254
},
"kind": "synthesis",
"functions": [
Expand All @@ -25,9 +19,7 @@
"expr": "4"
},
"direction": "output",
"is_signed": {
"expr": "False"
}
"is_signed": false
}
},
"parameters": [],
Expand Down
5 changes: 2 additions & 3 deletions algorithms/grover/3_sat_grover/3_sat_grover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
" (\"x2\", register_size),\n",
" (\"x3\", register_size),\n",
" ],\n",
" uncomputation_method=\"optimized\",\n",
")"
]
},
Expand Down Expand Up @@ -256,13 +255,13 @@
"source": [
"from classiq import execute, set_quantum_program_execution_preferences\n",
"from classiq.execution import (\n",
" ClassiqBackendPreferences,\n",
" ExecutionDetails,\n",
" ExecutionPreferences,\n",
" IBMBackendPreferences,\n",
")\n",
"\n",
"backend_preferences = ExecutionPreferences(\n",
" backend_preferences=IBMBackendPreferences(backend_name=\"aer_simulator\")\n",
" backend_preferences=ClassiqBackendPreferences(backend_name=\"aer_simulator\")\n",
")\n",
"\n",
"qprog = set_quantum_program_execution_preferences(qprog, backend_preferences)\n",
Expand Down
Loading

0 comments on commit d5fedfa

Please sign in to comment.