;NOAH-2 (SB): me-HSQC and HMBC
;Topspin 3 version 2017/09/09
;WaveMaker supported version
;Includes optional multiplicity editing in HSQC
;
;Ref: E. Kupce and T. Claridge, Angew.Chem.Int.Ed.Eng. 2017, v.56, pp. 11779-11783.
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

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

"p2=p1*2"
"p4=p3*2"
"d2=0.5s/cnst2"  
"d3=0.25s/cnst2"
"d12=d2-p2"
"d14=0.5s/cnst13"
"d0=3u"
"in0=inf1/2"
"l0=td1/4"

"DELTA=p16+d16+p1+4u+d0-p3*2/3.14159"
"DELTA1=d3-p14/2"
"DELTA2=d3+p14/2"
"DELTA3=d2+p3+p2/2"
"DELTA4=DELTA+p3-p2/2"
"DELTA5=DELTA2-p16-p3-de-8u+p1*2/3.14159"  

"acqt0=0"
baseopt_echo

1 ze
  30m pl12:f2
2 30m 
3 1m do:f2 
4 50u UNBLKGRAD
  4u pl1:f1
  p16:gp0
  4u
  (p1 ph1)
  4u
  p16:gp0*1.37
  50u BLKGRAD
  d1 st0

  (p1 ph1)
  DELTA1 
  (p14:sp3 ph6):f2 
  (p2 ph1):f1 
  DELTA2 pl2:f2 UNBLKGRAD
  (p1 ph2):f1 
  (p3 ph3):f2
  DELTA  
  (p14:sp3 ph6):f2 
  4u
  p16:gp1*EA
  d16
  d0 
  (p2 ph4)
  d0
  4u
  p16:gp1*EA
  d16

#ifdef EDIT     ;optional multiplicity editing
  DELTA3           
  (p14:sp3 ph6):f2 
  DELTA4  
  (p2 ph2):f1 	
  d2 pl2:f2
#else
  (p14:sp3 ph6):f2 
  DELTA pl2:f2
#endif /*EDIT*/

  (p3 ph5):f2
  (p1 ph1):f1 
  DELTA1 
  (p14:sp3 ph6):f2 
  (p2 ph1):f1 
  p16:gp2
  DELTA5 pl2:f2
  4u BLKGRAD      
  (p3 ph1):f2
  4u pl12:f2
  goscnp ph31 cpd2:f2      ; HSQC
  4u do:f2
  4u pl2:f2  
  50u UNBLKGRAD
  (p3 ph1):f2
  4u
  p16:gp0*0.77
  2m st           ; arbitrary delay
  (p1 ph1) 
  d2              ; J-filter 
  (p3 ph6):f2 
  d14              
  (p3 ph5):f2
  DELTA  
  (p14:sp3 ph6):f2 
  4u
  p16:gp1*EA
  d16
  d0 
  (p2 ph4)
  d0
  4u
  p16:gp1*EA
  d16
  (p14:sp3 ph6):f2 
  DELTA pl2:f2
  (p3 ph3):f2
  4u
  p16:gp2
  d16
  go=2 ph31     ; HMBC
  30m wr #0 if #0 zd igrad EA

  lo to 3 times 2 
  1m id0
  lo to 4 times l0

  50u BLKGRAD
exit

ph1=0 
ph2=1
ph3=0 2
ph4=0 0 0 0 2 2 2 2
ph5=0 0 2 2
ph6=0
ph31=0 2 2 0 

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling
;sp3: f2 channel - shaped pulse 180 degree
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p4 : f2 channel - 180 degree high power pulse
;p14: f2 channel - 180 degree shaped pulse for inversion
;p16: homospoil/gradient pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay
;d2 : delay for HSQC multiplicity editing 1/2J(XH)    [~3.45 msec]
;d11: delay for disk I/O                             [5 msec]
;d16: delay for homospoil/gradient recovery
;aq: acquisition time
;cnst2: = J(XH)
;cnst13: = J(XH) long range
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;nd0: 2
;nbl: 2
;ns: 1 * n
;ds: >= 16
;td1: number of experiments
;FnMODE: echo-antiecho
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence
; ~~~~~~~ use 'wvm -a' command to create these shapes ~~~~~~~~~~~~~~~~~~~
;sp3:wvm:wu180C13: cawurst-20(80 kHz, 0.5 ms)
;cpd2:wvm:wudec: cawurst_d-20(220 ppm, 1.4 ms)

;use gradient ratio:	gp 1 : gp 2
;			  80 : 40.2    for C-13
;			  80 : 16.2    for N-15

;for z-only gradients:
;gpz0: 17.13%
;gpz1: 80%
;gpz2: 40.2% for C-13, 16.2% for N-15

;use gradient files:
;gpnam0: SMSQ10.100   
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;EDIT: for C-13 multiplicity editing start experiment with 
;             option -DEDIT (eda: ZGOPTNS)
