-
Notifications
You must be signed in to change notification settings - Fork 1
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
Examples l4 submission #6
Open
irfankhan10
wants to merge
8
commits into
CQCL:main
Choose a base branch
from
irfankhan10:examples_l4_submission
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
58149d8
ignore .env directory
irfankhan10 83f9d06
add example for tket compiler option via pytket-azure
irfankhan10 d2c8fb4
notebook subitting L4 options to azure to customize emulator noise model
irfankhan10 7f8d50a
remove .env line from .gitignore
irfankhan10 7e0020a
add links as suggested by Alec
irfankhan10 88af989
modify sentence to add relevance to AzureBackend
irfankhan10 17607d1
incorporate alec's modification
irfankhan10 d7b23ca
Merge branch 'main' into examples_l4_submission
cqc-alec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<div style=\"text-align: center;\"><br>\n", | ||
"<img src=\"https://assets-global.website-files.com/62b9d45fb3f64842a96c9686/62d84db4aeb2f6552f3a2f78_Quantinuum%20Logo__horizontal%20blue.svg\" width=\"200\" height=\"200\" /></div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# TKET Compilation in H-Series Stack" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Circuits submitted to Quantinuum H-Series systems, except for integrated hybrid submissions, are automatically run through TKET compilation passes for H-Series hardware. This enables circuits to be automatically optimized for H-Series systems and run more efficiently.\n", | ||
"\n", | ||
"More information on the specific compilation passes applied can be found in the [pytket-quantinuum documentation](https://tket.quantinuum.com/extensions/pytket-quantinuum/#default-compilation).\n", | ||
"\n", | ||
"In the H-Series software stack, the optimization level applied is set with the `tket-opt-level` parameter. The default compilation setting for all circuits submitted to H-Series systems is optimization level 2.\n", | ||
"\n", | ||
"Users who would like to experiment with the TKET compilation passes and see what optimizations would apply to their circuits before submitting any jobs can see [Quantinuum_compile_without_api.ipynb](https://github.com/CQCL/pytket-quantinuum/blob/main/examples/Quantinuum_compile_without_api.ipynb).\n", | ||
"\n", | ||
"To turn TKET compilation in the stack off, a different option, `no-opt`, can be set to `True` inside `option_params`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pytket.circuit import Circuit\n", | ||
"\n", | ||
"circuit = Circuit(2)\n", | ||
"circuit.H(0).CX(0, 1)\n", | ||
"circuit.measure_all();" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pytket.extensions.azure import AzureBackend\n", | ||
"\n", | ||
"backend = AzureBackend(name=\"quantinuum.sim.h1-1e\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"option_params = {\n", | ||
" \"tket-opt-level\": 1\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"compiled_circuit = backend.get_compiled_circuit(circuit)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"handle = backend.process_circuit(compiled_circuit, n_shots=100, option_params=option_params)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"backend.circuit_status(handle)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"result = backend.get_result(handle)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<div align=\"center\"> © 2024 by Quantinuum. All Rights Reserved. </div>" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<div style=\"text-align: center;\"><br>\n", | ||
"<img src=\"https://assets-global.website-files.com/62b9d45fb3f64842a96c9686/62d84db4aeb2f6552f3a2f78_Quantinuum%20Logo__horizontal%20blue.svg\" width=\"200\" height=\"200\" /></div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Emulator Noise Parameters" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Users have the option of experimenting with the noise parameters of the Quantinuum emulators. Only a few of the available noise parameters are highlighted here demonstrating how to pass tQuantinuum API options to `AzureBackend` at job submission time.\n", | ||
"\n", | ||
"For more information on the full set of noise parameters available, see the H-series emulator product data sheets on the [System Model H1](https://www.quantinuum.com/hardware/h1) and [System Model H2](https://www.quantinuum.com/hardware/h2) pages." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pytket.circuit import Circuit\n", | ||
"\n", | ||
"circuit = Circuit(2)\n", | ||
"circuit.H(0).CX(0, 1)\n", | ||
"circuit.measure_all();" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pytket.extensions.azure import AzureBackend\n", | ||
"\n", | ||
"backend = AzureBackend(name=\"quantinuum.sim.h1-1e\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"option_params = {\n", | ||
" \"error-params\": {\n", | ||
" \"p1\": 4e-5,\n", | ||
" \"p2\": 3e-3,\n", | ||
" \"p_meas\": [3e-3, 3e-3],\n", | ||
" \"p_init\": 4e-5,\n", | ||
" \"p_crosstalk_meas\": 1e-5,\n", | ||
" \"p_crosstalk_init\": 3e-5,\n", | ||
" \"p1_emission_ratio\": 6e-6,\n", | ||
" \"p2_emission_ratio\": 2e-4\n", | ||
" }\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"compiled_circuit = backend.get_compiled_circuit(circuit)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"handle = backend.process_circuit(compiled_circuit, n_shots=100, option_params=option_params)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"backend.circuit_status(handle)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"result = backend.get_result(handle)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<div align=\"center\"> © 2024 by Quantinuum. All Rights Reserved. </div>" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"name": "python", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.