Gate-Free State Preparation for Fast Variational Quantum Eigensolver Simulations
Author
Oinam Meitei, Bryan Gard, George Barron, David Pappas, Sophia Economou, Edwin Barnes, Nicholas Mayhall
Title
Gate-Free State Preparation for Fast Variational Quantum Eigensolver Simulations
Description
Gate-free state preparation for fast variational quantum eigensolver simulations: ctrl-VQE
Category
Academic Articles & Supplements
Keywords
Quantum Algorithms, Quantum Circuits, Quantum Chemistry, Optimization
URL
http://www.notebookarchive.org/2022-02-5ks45t2/
DOI
https://notebookarchive.org/2022-02-5ks45t2
Date Added
2022-02-12
Date Last Modified
2022-02-12
File Size
120.03 kilobytes
Supplements
Rights
Redistribution rights reserved



This file contains supplementary data for O.R. Meitei, B.T. Gard, G.S. Barron, et al., “Gate-free state preparation for fast variational quantum eigensolver simulations,” npj Quantum Inf, 7, 2021 155. https://doi.org/10.1038/s41534-021-00493-0.
Gate-Free State Preparation for Fast Variational Quantum Eigensolver Simulations
Gate-Free State Preparation for Fast Variational Quantum Eigensolver Simulations
Oinam Romesh Meitei, Bryan T. Gard, George S. Barron, David P. Pappas, Sophia E. Economou, Edwin Barnes and Nicholas J. Mayhall
(*Thisnotebookismeanttoserveasanillustrativeexampleandisnotmeanttoreflecttheexactcasespresentedintheabovepublication.Formorespecificdetailsaboutthesimulationscarriedouttomatchtheresultsofourpaperpleasecontactthecorrespondingauthorand/orrefertohttps://github.com/mayhallgroup/ctrlq.*)
Initial Constants
In[]:=
SetDirectory[NotebookDirectory[]];qubits=2;(*Setthenumberofqubitsinthesimulation*)numpulses=2;(*Setthenumberofdrivingpulsesoneachqubit*)tfinal=20;(*Setthetotalevolutiontimeforthedrivingpulseevolution*)ClearAll[drives]ClearAll[twin]twin[1,1]=0;(*Assumethatthedrivepulsesbegininthe"off"condition.Indexreferto[i,j]forqubitiandtimepulsej.*)twin[2,1]=0;twin[1,numpulses+1]=tfinal;(*Fixthefinalpulsetoendatthefinaltime*)twin[2,numpulses+1]=tfinal;gauss[a_,σ_,tg_]:=aExp-;Table[drives[j]=Piecewise[Table[{amp[j,i],twin[j,i]<t≤twin[j,i+1]},{i,1,numpulses}]],{j,1,qubits}];(*Composepiecewisesquarepulseswithamplitudeandvaryingtimewindows*)(*Table[drives[j]=Piecewise[Table[{gauss[amp[j,i],vars[j,i],mean[j,i]],twin[j,i]<t≤twin[j,i+1]},{i,1,numpulses}]],{j,1,qubits}];*)(*OptionallyuseGaussianpulsesinsteadofpiecewiseconstantpulses*)ω={2π*5.6,2π*5.4};(*Fixedqubitfrequenices*)gz=2π*9.759075*;(*Fixedqubitcouplings*)Ω={drives[1],drives[2]};r1=1.143;(*Relativecross-talkbetweenqubitswhenqubitoneisdriven.ThisisanempricallychosenfactorfromNISTexperiments.*)r2=0.7748;(*Relativecross-talkbetweenqubitswhenqubittwoisdriven.ThisisanempricallychosenfactorfromNISTexperiments.*)
2
(t-tg)
2
2
σ
-3
10
Rotating Frame
forced2level=(ω[[1]]-100*ωdrive[1,1])++(ω[[2]]-100*ωdrive[2,1])++KroneckerProduct[-PauliMatrix[3],-PauliMatrix[3]];(*ConstructtheHamiltonianintherotatingframefortwocoupledqubits*)
gz
2
KroneckerProduct[-PauliMatrix[3],IdentityMatrix[2]]
2
gz
2
KroneckerProduct[IdentityMatrix[2],-PauliMatrix[3]]
2
gz
4
driveterm=Ω[[1]]KroneckerProductPauliMatrix[1],
+Ω[[2]]KroneckerProduct
,PauliMatrix[1];(*Includeadrivingtermfordrivingeachqubit*)
1 | 0 |
0 | r1 |
1 | 0 |
0 | r2 |
TransHam=forced2level+driveterm;(*FullTransmonHamiltonian*)
Time Evolution
getparams=Cases[Variables[Level[TransHam,{-2}]],Except[t]];(*Getallvariablespresentinthesystem*)SSol[ham_]:=ParametricNDSolveValue[{S'[t]-Iham.S[t],S[0]Normal[SparseArray[{2,1}1,{Length@ham,1}]]},S,{t,0,tfinal},getparams](*SolvetheSchrodingerequation*)
Example Chemical Hamiltonians for Different Bond Distances
nucrep=0.7199690462585033;Ham1=(-1.052373245772859+nucrep)KroneckerProduct[IdentityMatrix[2],IdentityMatrix[2]]-0.39793742484318045KroneckerProduct[PauliMatrix[3],IdentityMatrix[2]]+0.18093119978423156KroneckerProduct[PauliMatrix[1],PauliMatrix[1]]+0.39793742484318045KroneckerProduct[IdentityMatrix[2],PauliMatrix[3]]-0.01128010425623538KroneckerProduct[PauliMatrix[3],PauliMatrix[3]];(*H_2atequilibriumdistance*)nucrep03=1.7639241633333336;Ham03=(-0.7537419603822506+nucrep03)KroneckerProduct[IdentityMatrix[2],IdentityMatrix[2]]-0.8086489109606416KroneckerProduct[PauliMatrix[3],IdentityMatrix[2]]+0.8086489109606416KroneckerProduct[IdentityMatrix[2],PauliMatrix[3]]-0.013287969435900604KroneckerProduct[PauliMatrix[3],PauliMatrix[3]]+0.1608185250129906KroneckerProduct[PauliMatrix[1],PauliMatrix[1]];nucrep07=0.7199690462585033;Ham07=(-1.052373245772859+nucrep07)KroneckerProduct[IdentityMatrix[2],IdentityMatrix[2]]+0.39793742484318045KroneckerProduct[IdentityMatrix[2],PauliMatrix[3]]-0.39793742484318045KroneckerProduct[PauliMatrix[3],IdentityMatrix[2]]-0.01128010425623538KroneckerProduct[PauliMatrix[3],PauliMatrix[3]]+0.18093119978423156KroneckerProduct[PauliMatrix[1],PauliMatrix[1]];
Optimization Example
In[]:=
ineqconst=Join[{getparams[[4*numpulses-2]]≤tfinal},Table[{-2π*0.05≤amp[1,i]≤2π*0.05},{i,1,numpulses}],Table[{-2π*0.05≤amp[2,i]≤2π*0.05},{i,1,numpulses}]];guessedopttime=16.1;(*Thereissomeminimumtime(inns)thatisrequiredbeforethefidelitycanreachadesiredvalue.Thisislimitedroughlybyaspeedlimitbutcanalsojustbeiteratedover.*)GroundStateEnergy=Min@Eigenvalues[Ham1];globaloptsqr=Module{fill1=SSol[TransHam][Sequence@@getparams][guessedopttime]},NMinimizeRe@Tr[(.Ham1.fill1)]-GroundStateEnergy,Sequence@@Flatten@ineqconst,≤ωdrive[1,1]≤,≤ωdrive[2,1]≤,Variables[getparams],Method{Automatic,"RandomSeed"RandomInteger[{100}]},MaxIterations2000(*OptimizetheresulingsolutionfromtheSchrodingerequationtothetargetgroundstateenergyoftheChemicalHamiltonian.Thisisalocaloptimizerandthereforemayrequireseveralrestartsbeforeagoodqualityminimumisfound.*)
fill1
ω[[1]]-1
100
ω[[1]]+1
100
ω[[2]]-1
100
ω[[2]]+1
100
Out[]=
{0.000313298,{amp[1,1]0.272565,amp[1,2]0.10954,amp[2,1]0.130462,amp[2,2]-0.148614,twin[1,2]-0.197202,twin[2,2]8.0327,ωdrive[1,1]0.349318,ωdrive[2,1]0.33258}}
Plot Results
In[]:=
zerozero=Flatten@Module[{params2=Variables[getparams]/.globaloptsqr[[2]]},Module[pop00=,Table[pop00,{t,0,guessedopttime,0.1}]]];zeroone=Flatten@Module[{params2=Variables[getparams]/.globaloptsqr[[2]]},Module[pop01=,Table[pop01,{t,0,guessedopttime,0.1}]]];onezero=Flatten@Module[{params2=Variables[getparams]/.globaloptsqr[[2]]},Module[pop10=,Table[pop10,{t,0,guessedopttime,0.1}]]];oneone=Flatten@Module[{params2=Variables[getparams]/.globaloptsqr[[2]]},Module[pop11=,Table[pop11,{t,0,guessedopttime,0.1}]]];ListPlot[{zerozero,zeroone,onezero,oneone},DataRange{0,16.1},JoinedTrue,PlotLegends{"|00>","|01>","|10>","|11>"},FrameTrue,FrameLabel{"t","Population"},PlotRangePaddingNone]
2
Abs[.KroneckerProduct[SparseArray[{1,1}1,{2,1}],SparseArray[{1,1}1,{2,1}]]]
SSol[TransHam][Sequence@@params2][t]
2
Abs[.KroneckerProduct[SparseArray[{1,1}1,{2,1}],SparseArray[{2,1}1,{2,1}]]]
SSol[TransHam][Sequence@@params2][t]
2
Abs[.KroneckerProduct[SparseArray[{2,1}1,{2,1}],SparseArray[{1,1}1,{2,1}]]]
SSol[TransHam][Sequence@@params2][t]
2
Abs[.KroneckerProduct[SparseArray[{2,1}1,{2,1}],SparseArray[{2,1}1,{2,1}]]]
SSol[TransHam][Sequence@@params2][t]
Out[]=
|
In[]:=
Module{params1=globaloptsqr[[2]]},Plot1000*/.params1,1000*/.params1,{t,0,guessedopttime},FrameTrue,FrameLabel{"t (ns)","Amplitude (MHz)"},PlotLegends{"Qubit 1 Pulse","Qubit 2 Pulse"},AxesFalse
drives[1]
2π
drives[2]
2π
Out[]=
|
In[]:=
eneterr=Flatten@Module[{params2=Variables[getparams]/.globaloptsqr[[2]]},Module[ene=Re[.Ham1.SSol[TransHam][Sequence@@params2][t]],Table[ene-GroundStateEnergy,{t,0,guessedopttime,0.1}]]];
SSol[TransHam][Sequence@@params2][t]
In[]:=
Module[{params1=Variables[getparams]/.globaloptsqr[[2]]},Module[{params2=Sequence@@params1},Module[{},ListLogPlot[{eneterr},JoinedTrue,DataRange{0,guessedopttime},FrameTrue,FrameLabel{"t","Energy Error"},PlotLegends{"E(t) Error"}]]]]
Out[]=
|


Cite this as: Oinam Meitei, Bryan Gard, George Barron, David Pappas, Sophia Economou, Edwin Barnes, Nicholas Mayhall, "Gate-Free State Preparation for Fast Variational Quantum Eigensolver Simulations" from the Notebook Archive (2022), https://notebookarchive.org/2022-02-5ks45t2

Download

