-
Notifications
You must be signed in to change notification settings - Fork 127
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
T phi experiment #355
Merged
Merged
T phi experiment #355
Changes from 51 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
ff5e9d7
Beginning implementation of T_phi
merav-aharoni c0f64c4
Added init files
merav-aharoni fef446b
Built circuits for T_phi
merav-aharoni 1f2867c
Merge branch 'main' into t_phi
merav-aharoni 8582ada
Defined class T_phi
merav-aharoni 94a0408
Added run method to class Tphi
merav-aharoni 5b742fd
Merged with main
merav-aharoni 68ad6f8
First stage of Tphi - up to run
merav-aharoni 0c063b1
Merge with main
merav-aharoni f0c0f84
Merged with main
merav-aharoni 1b328e7
Added test for Tphi. Added backend for testing, based on T1 and T2Ram…
merav-aharoni 8fa6dbb
black
merav-aharoni fdea969
Merged with main
merav-aharoni 049a13f
Fixed return FakeJob from TphiBackend.run
merav-aharoni 9db05c0
Merge branch 'main' of github.com:merav-aharoni/qiskit-experiments in…
merav-aharoni 12292de
Merge branch 'main' into t_phi
merav-aharoni f2b6e03
Merged with main
merav-aharoni d0bc161
Get sub-experiment analysis results from expdata.child_data
merav-aharoni b1a0b9a
Added _run_analysis for TphiAnalysis. Added parameter to BatchExperi…
merav-aharoni ea8e5f1
Cleaned up return value for Tphi analysis results. Computed the final…
merav-aharoni 7c79f02
black and lint
merav-aharoni c7b8728
Removed usage of 'units' in Tphi. Added usage of set_experiment_optio…
merav-aharoni f79d8a3
Removed unnecessary variable 'unit' and unnecessary imports.
merav-aharoni 026b5e8
Added missing 'TphiAnalysis in __init__
merav-aharoni 151f337
Added documentation for Tphi
merav-aharoni b0f710d
Added 'analysis' parameter to BatchExperiment and to CompositeExperiment
merav-aharoni b7395c5
Added title and section to tphi tutorial
merav-aharoni 1ff54e4
Merge branch 'main' into t_phi
merav-aharoni 2e5422a
Fixed Tphi computation. Wrote tutorial. Added computation with uncert…
merav-aharoni f970a68
black and lint
merav-aharoni 28b9976
Merge branch 'main' into t_phi
merav-aharoni ca2ef67
Fixed title of tutorial
merav-aharoni e522c09
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni 82f16f4
Removed unnecessary prints and empty lines
merav-aharoni 13262ce
Merge branch 'main' into t_phi
merav-aharoni 719e697
lint and black
merav-aharoni 6ebcd23
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni 1124684
Change of parameter merged from main
merav-aharoni 6170765
lint
merav-aharoni 77c9ff2
Added references for Tphi
merav-aharoni 3cafd78
Updated copyright to 2022. Added _set_backend to Tphi
merav-aharoni 28d9c32
black and lint
merav-aharoni 0fd6120
Merge branch 'main' into t_phi
merav-aharoni 9ecb257
Bug fix: parameter 'backend' was missing in calls to T1 and T2Ramsey
merav-aharoni 9189c00
Cleaned up Tphi tutorial
merav-aharoni bdb4b9d
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni 0f609a3
black
merav-aharoni a37d38c
Removed dataProcessor from default_options because it was causing a w…
merav-aharoni bcaacff
Merge branch 'main' into t_phi
merav-aharoni ccbba12
black and lint
merav-aharoni 208e462
Added release notes for tphi
merav-aharoni 97ebb23
Syntax changes resulting from code review
merav-aharoni e129cf7
Update qiskit_experiments/library/characterization/tphi.py
merav-aharoni 031019a
Update qiskit_experiments/library/characterization/tphi.py
merav-aharoni dc7dc50
Removed two unnecessary methods, and did some cleaning following sugg…
merav-aharoni e6d9ca1
Added class documentation. Removed overriding of shots
merav-aharoni 188d220
Removed unnecessary parameter that I previously added to BatchExperi…
merav-aharoni 71c70c4
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni aca48fc
Removed setting of shots in backend options. Changed 'block_for_resul…
merav-aharoni e76c7f0
Merge branch 'main' into t_phi
merav-aharoni 540a945
black
merav-aharoni c69f716
Syntax changes in tutorial
merav-aharoni 993cde9
black
merav-aharoni 45284b2
Fixed problems in math font in tutorial text
merav-aharoni 23fbff3
Syntax changes in tutorial
merav-aharoni 714d19e
Improved documentation in tutorial and in TphiExperiment class
merav-aharoni 7080654
Removed 'name' that was added previously to t1 and t2ramsey. Instead,…
merav-aharoni 6dddddf
Fixed setting of default options in Tphi
merav-aharoni 15602b8
Added links to classes in the release notes
merav-aharoni cabd8d8
Merged with main
merav-aharoni 1d00174
Added info on the tphi experiment to the release notes
merav-aharoni 9ebb855
Implemented a set_experiment_options for tphi, that sets the options …
merav-aharoni 5ab5b4c
Added test to check that circtuis are modified correctly when using s…
merav-aharoni 0514857
Merge branch 'main' into t_phi
merav-aharoni a2e56c3
Added component analysis classes to the constructor of TphiAnalysis()…
merav-aharoni cff6af6
Merge branch 'main' into t_phi
merav-aharoni cb4fb0d
black
merav-aharoni feb4342
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni d5fafc3
Merge branch 'main' into t_phi
merav-aharoni b52dd6f
Added setting of osc_freq to set_experiment_options. Added a respecti…
merav-aharoni 42e0139
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni 66333e8
Merge branch 'main' into t_phi
merav-aharoni b20d38b
Merge branch 'main' into t_phi
merav-aharoni bafdcc3
Changed variable name
merav-aharoni e6563ce
Merge branch 'main' into t_phi
merav-aharoni 9db90d8
Added to tests 'assertExperimentDone'
merav-aharoni bdb0828
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,242 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d90cef84", | ||
"metadata": {}, | ||
"source": [ | ||
"# $T_\\phi$ characterization" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "16825eb1", | ||
"metadata": {}, | ||
"source": [ | ||
"T is defined as by T_2* when removing the effect of T1, or more precisely:\n", | ||
"$1/T_2* = 1/2T_1 + 1/T_\\phi.$\n", | ||
"We therefore create a composite experiment consisting of a $T_1$ experiment and a $T_2* $ experiment. From the results of these two, we compute the results for T$_\\phi.$" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "bb7abc10", | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import qiskit\n", | ||
"from qiskit_experiments.library.characterization import Tphi\n", | ||
"from qiskit_experiments.library.characterization import TphiAnalysis" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "ba59e1ef", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"T1 for FakeVigo = 0.00012170801410836628\n", | ||
"[1.00e-06 1.10e-05 2.10e-05 3.10e-05 4.10e-05 5.10e-05 6.10e-05 7.10e-05\n", | ||
" 8.10e-05 9.10e-05 1.01e-04 1.11e-04 1.21e-04 1.31e-04 1.41e-04 1.51e-04\n", | ||
" 1.61e-04 1.71e-04 1.81e-04 1.91e-04 2.01e-04 2.11e-04 2.21e-04 2.31e-04\n", | ||
" 2.41e-04 2.51e-04 2.61e-04 2.71e-04 2.81e-04 2.91e-04 3.01e-04 3.11e-04\n", | ||
" 3.21e-04 3.31e-04 3.41e-04 3.51e-04 3.61e-04]\n", | ||
"[1e-06, 3e-06, 5e-06, 7.000000000000001e-06, 9.000000000000002e-06, 1.1000000000000003e-05, 1.3000000000000003e-05, 1.5000000000000002e-05, 1.7000000000000003e-05, 1.9000000000000004e-05, 2.1000000000000006e-05, 2.3000000000000003e-05, 2.5000000000000005e-05, 2.7000000000000006e-05, 2.9000000000000004e-05, 3.1e-05, 3.3e-05, 3.5000000000000004e-05, 3.7000000000000005e-05, 3.9000000000000006e-05, 4.100000000000001e-05, 4.3e-05, 4.5e-05, 4.7000000000000004e-05, 4.9000000000000005e-05]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# An Aer simulator\n", | ||
"from qiskit.test.mock import FakeVigo\n", | ||
"from qiskit.providers.aer import AerSimulator\n", | ||
"from qiskit.providers.aer.noise import NoiseModel\n", | ||
"\n", | ||
"# Create a pure relaxation noise model for AerSimulator\n", | ||
"noise_model = NoiseModel.from_backend(\n", | ||
" FakeVigo(), thermal_relaxation=True, gate_error=False, readout_error=False\n", | ||
")\n", | ||
"\n", | ||
"# Create a fake backend simulator\n", | ||
"backend = AerSimulator.from_backend(FakeVigo(), noise_model=noise_model)\n", | ||
"\n", | ||
"# Look up target T1 of qubit-0 from device properties\n", | ||
"qubit0_t1 = backend.properties().t1(0)\n", | ||
"print(\"T1 for FakeVigo = \" + str(qubit0_t1))\n", | ||
"\n", | ||
"# Time intervals to wait before measurement\n", | ||
"delays_t1 = np.arange(1e-6, 3 * qubit0_t1, 1e-5)\n", | ||
"print(delays_t1)\n", | ||
"\n", | ||
"# set the desired delays\n", | ||
"delays_t2 = list(np.arange(1e-6, 50e-6, 2e-6))\n", | ||
"print(delays_t2)\n", | ||
"qubit = 0\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "c7154472", | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"in t2ramsey _set_backend\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# Create an experiment for qubit 0 with the specified time intervals\n", | ||
"exp = Tphi(qubit=0, delays_t1=delays_t1, delays_t2=delays_t2, osc_freq=1e5)\n", | ||
"# Set scheduling method so circuit is scheduled for delay noise simulation\n", | ||
"exp.set_transpile_options(scheduling_method='asap')\n", | ||
"\n", | ||
"expdata = exp.run(backend=backend, analysis=TphiAnalysis()).block_for_results()\n", | ||
"result = expdata.analysis_results(\"T_phi\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "1d3c529a", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"DbAnalysisResultV1\n", | ||
"- name: T_phi\n", | ||
"- value: 1.1713979863091273e-05 ± 3.1442018893973085e-05\n", | ||
"- quality: bad\n", | ||
"- device_components: ['Q0']\n", | ||
"- verified: False\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# Print the result for T_phi\n", | ||
"print(result)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "75b81403", | ||
"metadata": { | ||
"scrolled": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"---------------------------------------------------\n", | ||
"Experiment: Tphi\n", | ||
"Experiment ID: 8c52fb0e-3ab3-47a9-8550-1a2d65e1438d\n", | ||
"Child Experiment Data: 2\n", | ||
"Status: ExperimentStatus.DONE\n", | ||
"Backend: aer_simulator(fake_vigo)\n", | ||
"Data: 62\n", | ||
"Analysis Results: 1\n", | ||
"Figures: 0\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# It is possible to see the results of the sub-experiments:\n", | ||
"print(expdata)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "5f69ac24", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"DbAnalysisResultV1\n", | ||
"- name: T1\n", | ||
"- value: 0.00012318856580158585 ± 2.2075141225835903e-06 s\n", | ||
"- χ²: 1.4066670765740719\n", | ||
"- quality: good\n", | ||
"- device_components: ['Q0']\n", | ||
"- verified: False\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(expdata.child_data(0).analysis_results(\"T1\"))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "17157f4c", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"DbAnalysisResultV1\n", | ||
"- name: T2star\n", | ||
"- value: 1.1182317523178244e-05 ± 2.865266987893251e-05 s\n", | ||
"- χ²: 1.0430271249496532\n", | ||
"- quality: bad\n", | ||
"- device_components: ['Q0']\n", | ||
"- verified: False\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(expdata.child_data(1).analysis_results(\"T2star\"))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f64045d7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"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.8.10" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
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
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
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
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
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
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
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.
I can't review the tutorial. Something's wrong with indent font. I'll review after it's fixed. Note that in Latex we're talking about
\varphi
and not\phi
.