aripekka / pyTTE

Package to calculate diffraction curves of deformed crystals by numerically integrating the Takagi-Taupin equations
MIT License
8 stars 2 forks source link

reflectivity at a magic angle (2) #15

Open luweb opened 1 year ago

luweb commented 1 year ago

Hello,

While running pyTTE on alpha-quartz in Laue geometry I observed that there is a sharp drop in integrated reflectivity when the in-plane rotation angle is 60deg (please see below). In this case the response becomes the same as that of a flat crystal, indicating that the crystal is insensitive to bending. Do you believe this is a physical phenomenon? Could you please guide me through the reasoning behind this effect? This is interesting, but scary result as the in-plane rotation angle of our crystals are unknown. image

aripekka commented 1 year ago

Hi,

Sorry for the late reply. There is a similar effect in the Bragg case where at certain Bragg angles the curvature of the diffracting crystal planes cancels out deformation gradient due to elastic bending which makes the reflectivity curve look like that of a perfect unbent crystal.

Laue geometry is a bit different and I am not as familiar with it as I am with the Bragg geometry but I believe that that your observation may be related to the same phenomenon. I'm on the road now and I can't wrap my head around how the inplane angle causes that but, if you reply with the code you've been using, I can check if it's a physical phenomenon or a bug in the code.

On Fri, 4 Aug 2023, 22.06 Lucas Webster, @.***> wrote:

Hello,

While running pyTTE on alpha-quartz in Laue geometry I observed that there is a sharp drop in integrated reflectivity when the in-plane rotation angle is 60deg (please see below). In this case the response becomes the same as that of a flat crystal, indicating that the crystal is insensitive to bending. Do you believe this is a physical phenomenon? Could you please guide me through the reasoning behind this effect? This is interesting, but scary result as the in-plane rotation angle of our crystals are unknown. [image: image] https://user-images.githubusercontent.com/4827236/258507571-56b9ab61-d294-4231-a868-4ddf85d080ad.png

— Reply to this email directly, view it on GitHub https://github.com/aripekka/pyTTE/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV5DU7FV2IZG6UNFIUF2RLXTVB4XANCNFSM6AAAAAA3ESW4YE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

luweb commented 1 year ago

Hi Aripekka,

Thanks for getting back to me. Here's the code I used to make the plot. I'd really appreciate it if you could take a look and let me know if you spot any bugs. Your help means a lot!

import numpy as np
import os
from numpy import *
from pylab import *

import matplotlib as mpl

cbank0 = ['r','g','b','m','y','c','C1','C2','C3','C4','C5','C6','C7','C8','C9']
cbank1 = cbank0
cbank2 = cbank0

cbank = cbank0+cbank1+cbank2
cbank = cbank+cbank+cbank

from pyTTE import TakagiTaupin, TTcrystal, TTscan, Quantity

# INPUT #############################################
en = 10.0
cryst_ = 'AlphaQuartz'
h_ = 1
k_ = 0
l_ = 0
#
Rx_ = -12.0 #cm
Ry_ = None  #cm
crti = 0.10 #mm
phi = arange(0,180,30) # in plane rotation phi

dfm_model = 'shape'

#####################################################

fig1 = plt.figure(1,figsize=(10,8))
Rs_int_ = []
Rp_int_ = []
count = 0
xtal = TTcrystal(crystal=cryst_, hkl=[h_,k_,l_], thickness=Quantity(crti,'mm'), Rx = Quantity(Rx_,'cm'), Ry = Ry_, asymmetry = Quantity(90, 'deg'), fix_to_axes = dfm_model)

for p in phi:
  xtal.set_in_plane_rotation(Quantity(p,'deg'))
  print(xtal)
  scan_sig = TTscan(constant = Quantity(en,'keV'), scan = Quantity(np.linspace(-350,200,550),'urad'), polarization = 'sigma')
  scan_pi = TTscan(constant = Quantity(en,'keV'), scan = Quantity(np.linspace(-350,200,550),'urad'), polarization = 'pi')
  tt_sig = TakagiTaupin(xtal, scan_sig)
  tt_pi = TakagiTaupin(xtal, scan_pi)
  #  
  sv_sig, r_sig, t_sig = tt_sig.run()
  sv_pi, r_pi, t_pi = tt_pi.run()
  #  
  plt.plot(sv_sig,r_sig, color=cbank[count], linestyle='-',  label='$R_{\\sigma}$'+'{:.1f}'.format(p)+' deg')
  plt.plot(sv_pi, r_pi,  color=cbank[count], linestyle='--',  label='$R_{\\pi}$ '+'%.1f' % p +' deg')

  print('sum (sv_sig-sv_pi) = ', sum(sv_sig-sv_pi))

  dth_s = gradient(sv_sig) # [urad]
  dth_p = gradient(sv_pi)
  Rs_int = sum(dth_s*r_sig) 
  Rp_int = sum(dth_p*r_pi)
  Rs_int_ += [Rs_int]
  Rp_int_ += [Rp_int]

  count = count + 1 

Rs_int_ = array(Rs_int_)
Rp_int_ = array(Rp_int_)
Rav_int_ = 0.5*(Rs_int_ + Rp_int_)

plt.legend(loc='upper right') 

fig2 = plt.figure(2,figsize=(10,8))
ax1 = fig2.add_subplot(111)
ax1.plot(phi,Rav_int_,'bs-',label='pyTTE')
ax1.set_xlabel('phi [deg]')
ax1.set_ylabel('Integrated Reflectivity [$\\mu$rad]')

ax1.legend(loc='upper right')

plt.show()
aripekka commented 1 year ago

Dear Lucas,

Sorry for the delay but I took a look at your code and it seems to me that the effect is real.

I remember reading years ago that in the Laue case you shouldn't see the effect of bending for an elastically isotropic crystal and for particular crystal directions of certain anisotropic crystals too. This is because in contrast to the Bragg case, the diffracting planes are oriented perpendicular to the surface of the crystal and the bending only rotates them without causing a strain gradient. Therefore the Laue curve should be the same as for the perfect crystal. You can see this by using the isotropic model for the crystal (but change Ry to 'inf', None crashes)

However, this is not true for all crystals. In some cases, like for this alpha-quartz, there are shear components S_41, S_42, S_61 and S_62 in the compliance matrix S, which cause an additional term to du_x/d_z [eq. (32) in the documentation.pdf]. This on the other hand effect the Laue diffraction at small Bragg angles i.e. near normal incidence. At the 60 deg magic in-plane angle, it just happens so that these shear terms are zero in the S-matrix and therefore you don't see broadening of the diffraction curve as for other in-plane angles.

On Mon, 28 Aug 2023, 21.20 Lucas Webster, @.***> wrote:

Hi Aripekka,

Thanks for getting back to me. Here's the code I used to make the plot. I'd really appreciate it if you could take a look and let me know if you spot any bugs. Your help means a lot!

`import numpy as np import os from numpy import from pylab import

import matplotlib as mpl

cbank0 = ['r','g','b','m','y','c','C1','C2','C3','C4','C5','C6','C7','C8','C9'] cbank1 = cbank0 cbank2 = cbank0 cbank = cbank0+cbank1+cbank2 cbank = cbank+cbank+cbank

from pyTTE import TakagiTaupin, TTcrystal, TTscan, Quantity INPUT

en = 10.0 cryst = 'AlphaQuartz' h = 1 k = 0 l = 0

Rx = -12.0 #cm Ry = None #cm crti = 0.10 #mm phi = arange(0,180,30) # in plane rotation phi

dfm_model = 'shape'

#####################################################

fig1 = plt.figure(1,figsize=(10,8)) Rsint = [] Rpint = [] count = 0 xtal = TTcrystal(crystal=cryst, hkl=[h,k,l], thickness=Quantity(crti,'mm'), Rx = Quantity(Rx,'cm'), Ry = Ry, asymmetry = Quantity(90, 'deg'), fix_to_axes = dfm_model)

for p in phi: xtal.set_in_plane_rotation(Quantity(p,'deg')) print(xtal) scan_sig = TTscan(constant = Quantity(en,'keV'), scan = Quantity(np.linspace(-350,200,550),'urad'), polarization = 'sigma') scan_pi = TTscan(constant = Quantity(en,'keV'), scan = Quantity(np.linspace(-350,200,550),'urad'), polarization = 'pi') tt_sig = TakagiTaupin(xtal, scan_sig) tt_pi = TakagiTaupin(xtal, scan_pi)

sv_sig, r_sig, t_sig = tt_sig.run() sv_pi, r_pi, t_pi = tt_pi.run()

plt.plot(sv_sig,rsig, color=cbank[count], linestyle='-', label='$R{\sigma}$'+'{:.1f}'.format(p)+' deg') plt.plot(sv_pi, rpi, color=cbank[count], linestyle='--', label='$R{\pi}$ '+'%.1f' % p +' deg')

print('sum (sv_sig-sv_pi) = ', sum(sv_sig-sv_pi))

dth_s = gradient(sv_sig) # [urad] dth_p = gradient(sv_pi) Rs_int = sum(dth_s r_sig) Rp_int = sum(dth_pr_pi) Rsint += [Rs_int] Rpint += [Rp_int]

count = count + 1

Rsint = array(Rsint) Rpint = array(Rpint) Ravint = 0.5*(Rsint + Rpint)

plt.legend(loc='upper right')

fig2 = plt.figure(2,figsize=(10,8)) ax1 = fig2.add_subplot(111) ax1.plot(phi,Ravint,'bs-',label='pyTTE') ax1.set_xlabel('phi [deg]') ax1.set_ylabel('Integrated Reflectivity [$\mu$rad]')

ax1.legend(loc='upper right')

plt.show()`

— Reply to this email directly, view it on GitHub https://github.com/aripekka/pyTTE/issues/15#issuecomment-1696139824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV5DUZFNGNDNV3LKGMF2Z3XXTOPTANCNFSM6AAAAAA3ESW4YE . You are receiving this because you commented.Message ID: @.***>

luweb commented 1 year ago

I see, thank you so much Aripekka, this was very helpful! The shear components do go to zero at the magic angle. I can't quite visualize why that is the case, but thank you for providing a direction, I will give this some more thought.

image