Skip to content

Making imports explicit. #1033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions algorithms/algebraic/discrete_log/discrete_log.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"id": "2bbc4aa3-8f61-433d-a1cd-c58df445a2fd",
"metadata": {},
"outputs": [],
"source": [
"from classiq import *\n",
"from classiq import CInt, Output, QArray, QBit, QNum, allocate, modular_exp, qfunc\n",
"\n",
"\n",
"@qfunc\n",
Expand Down Expand Up @@ -106,11 +106,12 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"id": "d7fb63ac-023d-40ac-9395-13c1274d446f",
"metadata": {},
"outputs": [],
"source": [
"from classiq import hadamard_transform, invert, qft\n",
"from classiq.qmod.symbolic import ceiling, log\n",
"\n",
"\n",
Expand Down Expand Up @@ -207,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"id": "8e9d0b08-f3f8-4e95-a468-bfeec010d97c",
"metadata": {},
"outputs": [
Expand All @@ -218,6 +219,7 @@
}
],
"source": [
"from classiq import Constraints, create_model, execute, show, synthesize\n",
"from classiq.execution import ExecutionPreferences\n",
"\n",
"constraints = Constraints(max_width=13)\n",
Expand Down Expand Up @@ -344,11 +346,13 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"id": "8094b773-559f-429b-a057-d66b07311bff",
"metadata": {},
"outputs": [],
"source": [
"from classiq import Preferences, prepare_uniform_trimmed_state\n",
"\n",
"MODULU_NUM = 13\n",
"G_GENERATOR = 7\n",
"X_LOGARITHM = 3\n",
Expand Down Expand Up @@ -592,7 +596,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -606,7 +610,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
24 changes: 20 additions & 4 deletions algorithms/algebraic/hidden_shift/hidden_shift.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "8ede4222-6164-4c18-8679-bc93d9071b21",
"metadata": {},
"outputs": [
Expand All @@ -67,7 +67,23 @@
}
],
"source": [
"from classiq import *\n",
"from classiq import (\n",
" Constraints,\n",
" Output,\n",
" QArray,\n",
" QBit,\n",
" QCallable,\n",
" Z,\n",
" allocate,\n",
" bind,\n",
" create_model,\n",
" execute,\n",
" hadamard_transform,\n",
" phase_oracle,\n",
" qfunc,\n",
" show,\n",
" synthesize,\n",
")\n",
"\n",
"\n",
"@qfunc\n",
Expand Down Expand Up @@ -571,7 +587,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -585,7 +601,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
30 changes: 26 additions & 4 deletions algorithms/algebraic/shor/shor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "10",
"metadata": {
"ExecuteTime": {
Expand All @@ -141,7 +141,29 @@
"source": [
"import math\n",
"\n",
"from classiq import *\n",
"from classiq import (\n",
" CPHASE,\n",
" PHASE,\n",
" CInt,\n",
" Constraints,\n",
" H,\n",
" Output,\n",
" Preferences,\n",
" QArray,\n",
" QBit,\n",
" X,\n",
" allocate,\n",
" create_model,\n",
" execute,\n",
" hadamard_transform,\n",
" invert,\n",
" qft,\n",
" qfunc,\n",
" repeat,\n",
" show,\n",
" synthesize,\n",
" write_qmod,\n",
")\n",
"from classiq.qmod.symbolic import pi\n",
"\n",
"\n",
Expand Down Expand Up @@ -828,7 +850,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -842,7 +864,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "9f6fb018",
"metadata": {
"tags": []
Expand All @@ -98,7 +98,33 @@
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"from classiq import *"
"from classiq import (\n",
" Constraints,\n",
" H,\n",
" Output,\n",
" Pauli,\n",
" QArray,\n",
" QBit,\n",
" QNum,\n",
" U,\n",
" X,\n",
" Z,\n",
" allocate,\n",
" bind,\n",
" control,\n",
" create_model,\n",
" execute,\n",
" inplace_prepare_state,\n",
" invert,\n",
" linear_pauli_rotations,\n",
" qfunc,\n",
" qpe,\n",
" set_constraints,\n",
" show,\n",
" synthesize,\n",
" within_apply,\n",
" write_qmod,\n",
")"
]
},
{
Expand Down Expand Up @@ -601,7 +627,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -615,7 +641,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,43 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "98a57228-2722-4be7-a40f-b15d990962d7",
"metadata": {},
"outputs": [],
"source": [
"from classiq import *\n",
"from classiq import (\n",
" CInt,\n",
" Constraints,\n",
" H,\n",
" Output,\n",
" QArray,\n",
" QBit,\n",
" QCallable,\n",
" QNum,\n",
" QStruct,\n",
" U,\n",
" X,\n",
" Z,\n",
" allocate,\n",
" apply_to_all,\n",
" bind,\n",
" cfunc,\n",
" control,\n",
" create_model,\n",
" execute,\n",
" hadamard_transform,\n",
" invert,\n",
" iqae,\n",
" power,\n",
" qfunc,\n",
" qpe,\n",
" save,\n",
" show,\n",
" synthesize,\n",
" within_apply,\n",
")\n",
"from classiq.qmod.qmod_constant import QConstant\n",
"\n",
"A_SIZE = 2\n",
"B_SIZE = 2\n",
Expand Down Expand Up @@ -517,7 +548,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "85f99785-3da4-4dbf-9535-e32698d81431",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -694,7 +725,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -708,7 +739,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
29 changes: 24 additions & 5 deletions algorithms/aqc/solving_qlsp/solving_qlsp_with_aqc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,32 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "53fd717f-ba12-441b-ba8d-92eb08dde328",
"metadata": {},
"outputs": [],
"source": [
"from classiq import *\n",
"from classiq.execution import *\n",
"from classiq import (\n",
" CArray,\n",
" Output,\n",
" PauliTerm,\n",
" QArray,\n",
" QBit,\n",
" create_model,\n",
" execute,\n",
" matrix_to_hamiltonian,\n",
" prepare_state,\n",
" qfunc,\n",
" show,\n",
" suzuki_trotter,\n",
" synthesize,\n",
" write_qmod,\n",
")\n",
"from classiq.execution import (\n",
" ClassiqBackendPreferences,\n",
" ClassiqSimulatorBackendNames,\n",
" ExecutionPreferences,\n",
")\n",
"\n",
"\n",
"def setup_QLSP(A, b):\n",
Expand Down Expand Up @@ -1243,7 +1262,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -1257,7 +1276,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading