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

T phi experiment #355

Merged
merged 87 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ff5e9d7
Beginning implementation of T_phi
merav-aharoni Jul 22, 2021
c0f64c4
Added init files
merav-aharoni Jul 30, 2021
fef446b
Built circuits for T_phi
merav-aharoni Aug 18, 2021
1f2867c
Merge branch 'main' into t_phi
merav-aharoni Aug 18, 2021
8582ada
Defined class T_phi
merav-aharoni Aug 18, 2021
94a0408
Added run method to class Tphi
merav-aharoni Sep 9, 2021
5b742fd
Merged with main
merav-aharoni Sep 9, 2021
68ad6f8
First stage of Tphi - up to run
merav-aharoni Sep 22, 2021
0c063b1
Merge with main
merav-aharoni Oct 6, 2021
f0c0f84
Merged with main
merav-aharoni Jan 6, 2022
1b328e7
Added test for Tphi. Added backend for testing, based on T1 and T2Ram…
merav-aharoni Jan 6, 2022
8fa6dbb
black
merav-aharoni Jan 6, 2022
fdea969
Merged with main
merav-aharoni Jan 6, 2022
049a13f
Fixed return FakeJob from TphiBackend.run
merav-aharoni Jan 13, 2022
9db05c0
Merge branch 'main' of github.com:merav-aharoni/qiskit-experiments in…
merav-aharoni Jan 13, 2022
12292de
Merge branch 'main' into t_phi
merav-aharoni Jan 16, 2022
f2b6e03
Merged with main
merav-aharoni Jan 16, 2022
d0bc161
Get sub-experiment analysis results from expdata.child_data
merav-aharoni Jan 16, 2022
b1a0b9a
Added _run_analysis for TphiAnalysis. Added parameter to BatchExperi…
merav-aharoni Jan 16, 2022
ea8e5f1
Cleaned up return value for Tphi analysis results. Computed the final…
merav-aharoni Jan 18, 2022
7c79f02
black and lint
merav-aharoni Jan 18, 2022
c7b8728
Removed usage of 'units' in Tphi. Added usage of set_experiment_optio…
merav-aharoni Jan 18, 2022
f79d8a3
Removed unnecessary variable 'unit' and unnecessary imports.
merav-aharoni Jan 18, 2022
026b5e8
Added missing 'TphiAnalysis in __init__
merav-aharoni Jan 18, 2022
151f337
Added documentation for Tphi
merav-aharoni Jan 19, 2022
b0f710d
Added 'analysis' parameter to BatchExperiment and to CompositeExperiment
merav-aharoni Jan 20, 2022
b7395c5
Added title and section to tphi tutorial
merav-aharoni Jan 20, 2022
1ff54e4
Merge branch 'main' into t_phi
merav-aharoni Jan 20, 2022
2e5422a
Fixed Tphi computation. Wrote tutorial. Added computation with uncert…
merav-aharoni Jan 20, 2022
f970a68
black and lint
merav-aharoni Jan 20, 2022
28b9976
Merge branch 'main' into t_phi
merav-aharoni Jan 20, 2022
ca2ef67
Fixed title of tutorial
merav-aharoni Jan 23, 2022
e522c09
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Jan 23, 2022
82f16f4
Removed unnecessary prints and empty lines
merav-aharoni Jan 23, 2022
13262ce
Merge branch 'main' into t_phi
merav-aharoni Jan 23, 2022
719e697
lint and black
merav-aharoni Jan 23, 2022
6ebcd23
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Jan 23, 2022
1124684
Change of parameter merged from main
merav-aharoni Jan 23, 2022
6170765
lint
merav-aharoni Jan 23, 2022
77c9ff2
Added references for Tphi
merav-aharoni Jan 23, 2022
3cafd78
Updated copyright to 2022. Added _set_backend to Tphi
merav-aharoni Jan 24, 2022
28d9c32
black and lint
merav-aharoni Jan 24, 2022
0fd6120
Merge branch 'main' into t_phi
merav-aharoni Jan 25, 2022
9ecb257
Bug fix: parameter 'backend' was missing in calls to T1 and T2Ramsey
merav-aharoni Jan 26, 2022
9189c00
Cleaned up Tphi tutorial
merav-aharoni Jan 26, 2022
bdb4b9d
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Jan 26, 2022
0f609a3
black
merav-aharoni Jan 26, 2022
a37d38c
Removed dataProcessor from default_options because it was causing a w…
merav-aharoni Jan 26, 2022
bcaacff
Merge branch 'main' into t_phi
merav-aharoni Jan 27, 2022
ccbba12
black and lint
merav-aharoni Jan 27, 2022
208e462
Added release notes for tphi
merav-aharoni Jan 27, 2022
97ebb23
Syntax changes resulting from code review
merav-aharoni Jan 27, 2022
e129cf7
Update qiskit_experiments/library/characterization/tphi.py
merav-aharoni Jan 27, 2022
031019a
Update qiskit_experiments/library/characterization/tphi.py
merav-aharoni Jan 27, 2022
dc7dc50
Removed two unnecessary methods, and did some cleaning following sugg…
merav-aharoni Jan 27, 2022
e6d9ca1
Added class documentation. Removed overriding of shots
merav-aharoni Jan 27, 2022
188d220
Removed unnecessary parameter that I previously added to BatchExperi…
merav-aharoni Jan 27, 2022
71c70c4
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Jan 27, 2022
aca48fc
Removed setting of shots in backend options. Changed 'block_for_resul…
merav-aharoni Jan 30, 2022
e76c7f0
Merge branch 'main' into t_phi
merav-aharoni Jan 30, 2022
540a945
black
merav-aharoni Jan 30, 2022
c69f716
Syntax changes in tutorial
merav-aharoni Jan 30, 2022
993cde9
black
merav-aharoni Jan 30, 2022
45284b2
Fixed problems in math font in tutorial text
merav-aharoni Jan 30, 2022
23fbff3
Syntax changes in tutorial
merav-aharoni Jan 30, 2022
714d19e
Improved documentation in tutorial and in TphiExperiment class
merav-aharoni Jan 30, 2022
7080654
Removed 'name' that was added previously to t1 and t2ramsey. Instead,…
merav-aharoni Jan 30, 2022
6dddddf
Fixed setting of default options in Tphi
merav-aharoni Jan 31, 2022
15602b8
Added links to classes in the release notes
merav-aharoni Jan 31, 2022
cabd8d8
Merged with main
merav-aharoni Jan 31, 2022
1d00174
Added info on the tphi experiment to the release notes
merav-aharoni Feb 1, 2022
9ebb855
Implemented a set_experiment_options for tphi, that sets the options …
merav-aharoni Feb 1, 2022
5ab5b4c
Added test to check that circtuis are modified correctly when using s…
merav-aharoni Feb 1, 2022
0514857
Merge branch 'main' into t_phi
merav-aharoni Feb 2, 2022
a2e56c3
Added component analysis classes to the constructor of TphiAnalysis()…
merav-aharoni Feb 3, 2022
cff6af6
Merge branch 'main' into t_phi
merav-aharoni Feb 3, 2022
cb4fb0d
black
merav-aharoni Feb 3, 2022
feb4342
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Feb 3, 2022
d5fafc3
Merge branch 'main' into t_phi
merav-aharoni Feb 3, 2022
b52dd6f
Added setting of osc_freq to set_experiment_options. Added a respecti…
merav-aharoni Feb 3, 2022
42e0139
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Feb 3, 2022
66333e8
Merge branch 'main' into t_phi
merav-aharoni Feb 6, 2022
b20d38b
Merge branch 'main' into t_phi
merav-aharoni Feb 6, 2022
bafdcc3
Changed variable name
merav-aharoni Feb 7, 2022
e6563ce
Merge branch 'main' into t_phi
merav-aharoni Feb 8, 2022
9db90d8
Added to tests 'assertExperimentDone'
merav-aharoni Feb 8, 2022
bdb0828
Merge branch 't_phi' of github.com:merav-aharoni/qiskit-experiments i…
merav-aharoni Feb 8, 2022
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
169 changes: 169 additions & 0 deletions docs/tutorials/tphi_characterization.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
Copy link
Collaborator

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.

"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "bb7abc10",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import qiskit\n",
"from qiskit_experiments.library.characterization import Tphi"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "65433519",
"metadata": {},
"outputs": [],
"source": [
"# set the computation units to microseconds\n",
"unit = 'us' #microseconds\n",
"qubit = 0\n",
"# set the desired delays\n",
"delays_t1 = list(range(1, 40, 3))\n",
"delays_t2 = list(range(1, 50, 2))\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "ba59e1ef",
"metadata": {},
"outputs": [],
"source": [
"exp = Tphi(qubit=0, delays_t1=delays_t1, delays_t2=delays_t2, unit=\"s\", osc_freq=0.1)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "c7154472",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" ┌───┐┌─────────────┐┌─────────┐ ░ ┌───┐ ░ ┌─┐\n",
"q_0: ┤ H ├┤ Delay(1[s]) ├┤ Rz(π/5) ├─░─┤ H ├─░─┤M├\n",
" └───┘└─────────────┘└─────────┘ ░ └───┘ ░ └╥┘\n",
"c: 1/═══════════════════════════════════════════╩═\n",
" 0 \n"
]
}
],
"source": [
"print(exp._experiments[1].circuits()[0])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1d3c529a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n"
]
}
],
"source": [
"print(exp.num_experiments)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "75b81403",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"backend = tphi_simulator\n",
"t1_shots = 1024\n"
]
},
{
"ename": "AttributeError",
"evalue": "'NoneType' object has no attribute 'job_id'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-4cbea993ed61>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mbackend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mTphiBackend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mt1\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt2ramsey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m25\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfreq\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdt_factor\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m#print(backend)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mexpdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mexp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbackend\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexperiment_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0;31m#print(expdata)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/work/t_phi/qiskit_experiments/library/characterization/tphi.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, backend, experiment_data, **run_options)\u001b[0m\n\u001b[1;32m 58\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbackend\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexperiment_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mrun_options\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 60\u001b[0;31m \u001b[0mexpdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbackend\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mshots\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1000\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 61\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/work/t_phi/qiskit_experiments/framework/base_experiment.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, backend, analysis, experiment_data, **run_options)\u001b[0m\n\u001b[1;32m 139\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 140\u001b[0m \u001b[0;31m# Add experiment option metadata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 141\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_add_job_metadata\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexperiment_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjob\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mrun_opts\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 142\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 143\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0manalysis\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__analysis_class__\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/work/t_phi/qiskit_experiments/framework/composite/composite_experiment.py\u001b[0m in \u001b[0;36m_add_job_metadata\u001b[0;34m(self, experiment_data, job, **run_options)\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_add_job_metadata\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexperiment_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjob\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mrun_options\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 71\u001b[0m \u001b[0;31m# Add composite metadata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 72\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_add_job_metadata\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexperiment_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjob\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mrun_options\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 73\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 74\u001b[0m \u001b[0;31m# Add sub-experiment options\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/work/t_phi/qiskit_experiments/framework/base_experiment.py\u001b[0m in \u001b[0;36m_add_job_metadata\u001b[0;34m(self, experiment_data, job, **run_options)\u001b[0m\n\u001b[1;32m 375\u001b[0m \"\"\"\n\u001b[1;32m 376\u001b[0m metadata = {\n\u001b[0;32m--> 377\u001b[0;31m \u001b[0;34m\"job_id\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mjob\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjob_id\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 378\u001b[0m \u001b[0;34m\"experiment_options\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexperiment_options\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__dict__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 379\u001b[0m \u001b[0;34m\"transpile_options\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtranspile_options\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__dict__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'job_id'"
]
}
],
"source": [
"\n",
"from qiskit_experiments.test.tphi_backend import TphiBackend\n",
"backend = TphiBackend(t1=10, t2ramsey=25, freq=0.1, dt_factor=1)\n",
"#print(backend)\n",
"expdata = exp.run(backend, experiment_data=None)\n",
"#print(expdata)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5f69ac24",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "17157f4c",
"metadata": {},
"outputs": [],
"source": []
},
{
"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
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _run_analysis(self, experiment_data: CompositeExperimentData, **options):
sub_qubits.append(expdata.experiment.physical_qubits)

result = AnalysisResultData(
name="parallel_experiment",
name="composite_experiment",
value=len(sub_types),
extra={
"experiment_types": sub_types,
Expand Down
3 changes: 2 additions & 1 deletion qiskit_experiments/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

~characterization.T1
~characterization.T2Ramsey
~characterization.Tphi
~characterization.QubitSpectroscopy
~characterization.EFSpectroscopy

Expand Down Expand Up @@ -94,7 +95,7 @@ class instance to manage parameters and pulse schedules.
FineSXAmplitude,
RamseyXY,
)
from .characterization import T1, T2Ramsey, QubitSpectroscopy, EFSpectroscopy
from .characterization import T1, T2Ramsey, Tphi, QubitSpectroscopy, EFSpectroscopy
from .randomized_benchmarking import StandardRB, InterleavedRB
from .tomography import StateTomography, ProcessTomography
from .quantum_volume import QuantumVolume
Expand Down
4 changes: 4 additions & 0 deletions qiskit_experiments/library/characterization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

T1
T2Ramsey
Tphi
QubitSpectroscopy


Expand All @@ -37,6 +38,7 @@

T1Analysis
T2RamseyAnalysis
TphiAnalysis
ResonanceAnalysis
"""
from .t1 import T1
Expand All @@ -46,3 +48,5 @@
from .ef_spectroscopy import EFSpectroscopy
from .t2ramsey import T2Ramsey
from .t2ramsey_analysis import T2RamseyAnalysis
from .tphi import Tphi
from .tphi_analysis import TphiAnalysis
2 changes: 1 addition & 1 deletion qiskit_experiments/library/characterization/t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def circuits(self, backend: Optional[Backend] = None) -> List[QuantumCircuit]:
circuits = []

for delay in self.experiment_options.delays:
circ = QuantumCircuit(1, 1)
circ = QuantumCircuit(1, 1, name="T1")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you ok with reverting this? I don't think we need it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just for a sanity check. But if it bothers you, I can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, let's discuss.

circ.x(0)
circ.barrier(0)
circ.delay(delay, 0, self.experiment_options.unit)
Expand Down
2 changes: 1 addition & 1 deletion qiskit_experiments/library/characterization/t2ramsey.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def circuits(self, backend: Optional[Backend] = None) -> List[QuantumCircuit]:

circuits = []
for delay in self.experiment_options.delays:
circ = qiskit.QuantumCircuit(1, 1)
circ = qiskit.QuantumCircuit(1, 1, name="T2*")
circ.h(0)
circ.delay(delay, 0, self.experiment_options.unit)
rotation_angle = (
Expand Down
61 changes: 61 additions & 0 deletions qiskit_experiments/library/characterization/tphi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# that they have been altered from the originals.
"""
Tphi Experiment class.
"""

from typing import List, Optional, Union
import numpy as np
from enum import Enum

import qiskit
from qiskit.providers import Backend
from qiskit.circuit import QuantumCircuit
from qiskit_experiments.framework import BaseExperiment
from qiskit_experiments.framework.composite.batch_experiment import BatchExperiment
from qiskit_experiments.library.characterization import T1, T2Ramsey
from qiskit_experiments.library.characterization.tphi_analysis import TphiAnalysis

class Tphi(BatchExperiment):
"""Tphi Experiment Class"""

__analysis_class__ = TphiAnalysis

def __init__(self,
qubit: int,
delays_t1: List[Union[List[float], np.array]],
delays_t2: List[Union[List[float], np.array]],
unit: str = "s",
osc_freq: float = 0.0,
experiment_type: Optional[str] = None,
):
"""Initialize the experiments object.
merav-aharoni marked this conversation as resolved.
Show resolved Hide resolved

Args:
qubit: the qubit under test
delays_t1: delay times of the T1 experiment
delays_t2: delay times of the T2* experiment
unit: Optional, time unit of `delays`.
Supported units: 's', 'ms', 'us', 'ns', 'ps', 'dt'.
The unit is used for both experiments
osc_freq: the oscillation frequency induced using by the user for T2
experiment_type: String indicating the experiment type.

merav-aharoni marked this conversation as resolved.
Show resolved Hide resolved
"""
#self._qubit = qubit
self._delays_t1 = delays_t1
self._delays_t2 = delays_t2
self._unit = unit
self._osc_freq = osc_freq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use options


expT1 = T1(qubit, self._delays_t1, self._unit)
expT2 = T2Ramsey(qubit, self._delays_t2, self._unit, self._osc_freq)
exps = []
exps.append(expT1)
exps.append(expT2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exps = [expT1, expT2]


# Run batch experiments
merav-aharoni marked this conversation as resolved.
Show resolved Hide resolved
batch_exp = super().__init__(exps)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable batch_exp is not used, just call super().__init__ without storing the result in a variable


def run(self, backend, experiment_data, **run_options):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't override run

expdata = super().run(backend, shots=1000)

2 changes: 1 addition & 1 deletion qiskit_experiments/test/t1_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run(self, run_input, **options):
prob1[qubit] = 1 - prob1[qubit]
elif op.name == "delay":
delay = op.params[0]
prob1[qubit] = prob1[qubit] * np.exp(-delay / self._t1[qubit])
prob1[qubit] = prob1[qubit] * np.exp(-delay / self._t1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [qubit] term should remain there. Different qubits can have different T1s and the user has to provide an array of T1s when initializing the backend.

elif op.name == "measure":
meas_res = self._rng.binomial(
1, prob1[qubit] * (1 - ro10[qubit]) + (1 - prob1[qubit]) * ro01[qubit]
Expand Down