;cSLIC PULSE SEQUENCE FOR DOUBLE-QUANTUM EXCITATION IN STRONGLY-COUPLED 2-SPIN-1/2 SYSTEMS
;FROM "Spinor Double-Quantum Excitation in the Solution NMR of Near-Equivalent Spin-1/2 Pairs"
;for assistance, contact mohamed@sabba.me

#include <Avance.incl>
#include <Grad.incl>

"p2=p1*2"
"d11=30m"
"p11=d2-p12-8u"
"p12=4*p1*d2/(4*p1+d2)"
"cnst21 = 90+asin(90/720)*DEG"
"cnst22 = 270+3*asin(90/720)*DEG"

"acqt0=-p1*2/3.1416"
1 ze
2 d1 pl1:f1

;BLOCK A: Iz to DQCs

	;STEP 1: full SLIC sequence which generates an Ix12 Hamiltonian
      1u pl11:f1								  ; set SLIC power
    3 2u
     (p11*0.5 ph1+cnst11):f1            ; 180(x) (omega_1 = omega_J)   
  	  2u pl1:f1                   ; set hard pulse power
      (p12*0.5 ph2):f1                ; 360(-x) (omega_1 = omega_high)
      2u 
      (p12*0.5 ph2):f1
      2u pl11:f1                  ; set SLIC pulse power
      (p11*0.5 ph1+cnst11):f1            ; 180(x) (omega_1 = omega_J)   
    lo to 3 times l1
      2u pl1:f1  ; return to hard pulse power
	;STEP 2: 90(x) pulse to create DQCs
    
    4 (p1*0.5 ph3):f1
      (p1*2 ph3+cnst21):f1
      (p1*4 ph3+cnst22):f1                 ; BB1 90(+x) pulse
      (p1*2 ph3+cnst21):f1
      (p1*0.5 ph3):f1

;BLOCK A: DQCs to Iz

	;STEP 4: full SLIC sequence which generates an Ix12 Hamiltonian

    5 (p1*0.5 ph13):f1
      (p1*2 ph13+cnst21):f1
      (p1*4 ph13+cnst22):f1                 ; BB1 90(+x) pulse
      (p1*2 ph13+cnst21):f1
      (p1*0.5 ph13):f1
      
      2u pl11:f1								   ; set SLIC power
    6 2u
      (p11*0.5 ph10+cnst11):f1            ; 180(x) (omega_1 = omega_J)   
  	  2u pl1:f1                   ; set hard pulse power
      (p12*0.5 ph12):f1                ; 360(-x) (omega_1 = omega_high)
      2u 
      (p12*0.5 ph12):f1
      2u pl11:f1                  ; set SLIC pulse power
      (p11*0.5 ph10+cnst11):f1            ; 180(x) (omega_1 = omega_J)   
    lo to 6 times l1
      1u pl1:f1  ; return to hard pulse power

;READOUT BLOCK

  ;STEP 7: z-filter
    40u UNBLKGRAD
    p21:gp1                        ; gradient pulse
    2m
    40u BLKGRAD

    7 (p1*0.5 ph20):f1
      (p1*2 ph20+cnst21):f1
      (p1*4 ph20+cnst22):f1                 ; BB1 90(-x) pulse
      (p1*2 ph20+cnst21):f1
      (p1*0.5 ph20):f1

  go=2 ph31
  30m mc #0 to 2 F0(zd)
exit

;BLOCK A PHASES
  ;PULSE 1
	ph1=0 0 0 0
  ;SLIC COMPENSATING PULSE
  ph2=2 2 2 2
  ;90 PULSE
	ph3=0 0 0 0

;BLOCK B PHASES
  ;PHI_{B}
  ph10=0 1 2 3
  ;SLIC
	ph11=ph1+ph10
  ;SLIC COMPENSATING PULSE
  ph12=ph2+ph10
  ;90 PULSE
	ph13=ph3+ph10
;readout pulse
  ph20=2 3 0 1
;Receiver phases
ph31=0 3 2 1

;p11 : SLIC soft k*360(x) pulse duration; this is (1/J)*k where k = omega_1 / (omega_1+omega_J)
;p12 : SLIC hard k*360(-x) pulse duration; this is (4*p1)*k where k = omega_1 / (omega_1+omega_J)
;p21 : gradient pulse duration
;d2 : SLIC beta(x)beta(-x) block duration: set to 1/J (duration of a full J-cycle)
;p1 : high power 90 pulse duration
;l1 : number of J-cycles ; set to 1.414*J/Delta
;cnst21 : BB1(90) phase
;cnst22 : BB1(90) phase 
;cnst11 : phase calibration parameter
;plw1 : pulse power (hard pulses)
;plw11 : pulse power (SLIC pulses)