Skip to content
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

Jthou #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CommitTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test content for git tutorial
121 changes: 121 additions & 0 deletions job_submission.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"id": "c15eaf50-995f-416c-af08-4e1581406269",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"New project created: My first project!\n"
]
}
],
"source": [
"from pytket.extensions.nexus import AerConfig\n",
"from pytket.extensions.nexus import Nexus\n",
"from pytket import Circuit\n",
"\n",
"\n",
"# Let's create a circuit\n",
"my_circ = Circuit(2, 2).H(0).CX(0, 1).measure_all()\n",
"\n",
"# Let's retrieve a NexusProject\n",
"my_project = Nexus().new_project(name=\"My first project!\")\n",
"\n",
"\n",
"# And finally a BackendConfig representing the target backend (in this case it's a simulator)\n",
"config = AerConfig()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "f04dde59-11c1-4e56-9678-a268a5ee90e1",
"metadata": {},
"outputs": [],
"source": [
"my_compile_job = my_project.submit_compile_job(\n",
" backend_config=config, circuits=[my_circ], name=\"my_compile_job_190\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "586b4925-61b5-472f-8ecf-6524c6c28e2f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"JobStatus(status=<JobStatusEnum.COMPLETED: 'COMPLETED'>, message='The job is completed.', error_detail=None, completed_time=datetime.datetime(2024, 2, 3, 21, 26, 4, 304603, tzinfo=datetime.timezone.utc), queued_time=None, submitted_time=datetime.datetime(2024, 2, 3, 21, 26, 3, 750337, tzinfo=datetime.timezone.utc), running_time=None, cancelled_time=None, error_time=None, queue_position=None)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# You can check on the status\n",
"my_compile_job.get_status()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "a24dfb2c-bff7-46bf-b49b-f6f9d373dcbc",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[JobStatus(status=<JobStatusEnum.COMPLETED: 'COMPLETED'>, message='Circuit has finished compiling.', error_detail=None, completed_time=datetime.datetime(2024, 2, 3, 21, 26, 4, 297666, tzinfo=datetime.timezone.utc), queued_time=None, submitted_time=datetime.datetime(2024, 2, 3, 21, 26, 3, 762909, tzinfo=datetime.timezone.utc), running_time=None, cancelled_time=None, error_time=None, queue_position=None)]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Or you can get more detailed status information about each item in the job\n",
"my_compile_job.get_item_statuses()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cd51aa77-f762-41bf-9474-ae83497d1439",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}