Package: graphenetools-py
Graphene ToolsA set of tools to generate the interaction of helium with uniaxially strained graphene (in the armchair direction) using optimized Lennard-Jones parameters fromNichols et al.and to print command line parameters for use with quantum Monte Carlo (QMC) software located atcode.delmaestro.org. Code to generate figures for 1D and 2D potential interactions included as well. Please cite the origial paper as:@article{Nichols2016,
  title = {Adsorption by design: Tuning atom-graphene van der Waals interactions via mechanical strain},
  author = {Nichols, Nathan S. and Del Maestro, Adrian and Wexler, Carlos and Kotov, Valeri N.},
  journal = {Phys. Rev. B},
  volume = {93},
  issue = {20},
  pages = {205412},
  numpages = {14},
  year = {2016},
  month = {May},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevB.93.205412},
  url = {https://link.aps.org/doi/10.1103/PhysRevB.93.205412}
}InstallationYou can install Graphene Tools fromPyPI:pip install graphenetools-pyHow to useSome command line tools have been included for convenience. Avaiable options are dermined by:python -m graphenetoolsFor example, to run the listed command to print the parameters corresponding to a roughtly square box commensurate with the $C_{1/3}$ phase with strain $\delta=0.25$ and 100 adsorption sites use:python -m gt_rs 5 --strain 0.25orgt_rs 5 --strain 0.25Advanced usageBetter usage of the Graphene Tools package can be achieved by importing the pacakge directly into your project or notebook environment usingfrom graphenetools import gt. Some advanced usage cases are discussed below.Lattice vectorsGenerate basis, lattice, and reciprocal lattice vectors for uniaxially strained graphene.strain=0.50# Strain value in armchair directionAm,An,b1,b2,gm,gn=gt.get_graphene_vectors(strain)$C_{1/3}$ phase lattice vectors can be generated too!strain=0.50# Strain value in armchair directionAm_c_one_third,An_c_one_third=gt.get_graphene_c_one_third_vectors(strain)Plot latticePlots of the graphene lattice can be made using theplot_graphene_lattice()function.# Here we plot a funky boxbox_dims=[-2.0,6.0,-3.0,8.0]strain=0.50fig,ax=gt.plot_graphene_lattice(strain,box_dims)fig.set_dpi(300)Additionally, the $C_{1/3}$ phase locations can be plotted along with the graphene lattice using theplot_graphene_lattice_with_c_one_third()function.# If given a single float or int box dims is [-box_dims/2,box_dims/2,-box_dims/2,box_dims/2]# Here we plot the graphene lattice and C1/3 adsorption sitesbox_dims=10strain=0.50fig,ax=gt.plot_graphene_lattice_with_c_one_third(strain,box_dims)fig.set_dpi(300)Generate QMC parametersSimulation parameters to produce a roughly square simulation cell commensurate with the $C_{1/3}$ phase for use with QMC software hosted atcode.delmaestro.orgcan be generated using theroughly_square()function and a plot of simulation cell generated using theroughly_square_plot()function.# Here we plot roughly square plots commensurate with the C1/3 adsorption sites and print out the relevant PIMC parametersstrain=0.00n=2# `(2n)^2` C1/3 adsorption sitesfig,ax=gt.roughly_square_plot(n,strain)gt.roughly_square(n,strain)#print out the relevant PIMC parametersfig.set_dpi(300)-N 16 --Lx 14.757072880486835 --Ly 17.04For non-"roughly square" command line parameters and plots use functionsc_one_third_commensurate_command()andc_one_third_commensurate_command_plot().# Here we plot a mostly rectangular plot commensurate with the C1/3 adsorption sites and print out the relevant PIMC parametersstrain=0.00m=3n=1fig,ax=gt.c_one_third_commensurate_command_plot(m,n,strain)gt.c_one_third_commensurate_command(m,n,strain)#print out the relevant PIMC parametersfig.set_dpi(300)-N 6 --Lx 22.135609320730254 --Ly 4.26Generate potential plotsThe potential can also be calculated for the helium-graphene interaction using Graphene Tools. Here are some demonstrations at various strains.0D potential plot (a single point)The potential can be generate at a single point using theV_64()function. Optimized parameters to the Lennard-Jones potential are obtained using theget_LJ_parameters()function.# Get optimized Lennard-Jones parameters for certain strainstrain=0.00conventional=True# Setting conventional to true will return the conventional parameterssigma,epsilon=gt.get_LJ_parameters(strain,conventional=conventional)_x=0.00_y=0.00_z=3.00# Generate helium-graphene interaction potential for a single pointcarbon_carbon_distance=1.42poisson_ratio=0.165k_max=10000potential="V"# can also generate the gradient or Laplacian by setting this variable to gradVx, gradVy, gradVz, or grad2Vgt.V_64(strain,sigma,epsilon,_x,_y,_z,carbon_carbon_distance=carbon_carbon_distance,poisson_ratio=poisson_ratio,k_max=k_max,potential=potential)-158.926222611120951D potential plotHere a 1D potential for a helium atom located above the graphene sheet is generated using thegenerate_V1D(). Note that the graphene sheets are centered on the center of the hexgonal unit (not centered on a carbon atom).# Generate a 1D potential along z-direction at specific (x,y) locationstrain=0.00x=0.0y=0.0z=gt.np.linspace(2.0,15.0,1001)V=gt.generate_V1D(x,y,z,strain=strain)#Using default arguments (check function for extensive list)Plots for multiple values of strain can be generated using theplot_V1D()function.x=0.00y=0.00z=gt.np.linspace(2,6,1001)dpi=300strains=gt.np.linspace(0,.25,6)mplstylefile="./include/notebook.mplstyle"fig,ax,V_array=gt.plot_V1D(x,y,z,strains=strains,mplstylefile=mplstylefile,dpi=dpi)fig.savefig("V1D_optimized_close.png",bbox_inches="tight")Minimum of 1D potentialThe minimum location and value of the potential for the different strain values can be determined using theget_z_min()andget_z_mins()functions.# Get minimum potential and location above graphene sheet for a single strain valuestrain=0.00z_min,V_min=gt.get_z_min(strain)# Get minimum potential and location above graphene sheet for multiple strainsstrains=gt.np.linspace(0,.25,6)z_mins,V_mins=gt.get_z_mins(strains)z_mins_conventional,V_mins_conventional=gt.get_z_mins(strains,conventional=True)Note the different behavior when using the optmized parameters from [Nichols et al.] compared with using the conventional parameters.#Plot zmplstylefile='default'withgt.plt.style.context(mplstylefile):fig,ax=gt.plt.subplots(dpi=300)ax.plot(strains,z_mins,label="optimized")ax.set_prop_cycle(None)ax.plot(strains,z_mins_conventional,linestyle=":",label=r"conventional")ax.set_xlabel(r"$\mathrm{strain}\ \delta$")ax.set_ylabel(r"$z_\mathrm{min}\ \mathrm{[\AA]}$")ax.legend()fig.savefig("zmin.png")2D potential plotHere a 2D potential lookup table for a helium atom located above the graphene sheet is generated over the unit cell using thegenerate_V2D_uc().strain=0.00resolution=101fn_prefix="./helium-graphene-2D-unit-cell"z_min,V_min=gt.get_z_min(strain)# Generate 2D lookup table on the unit cell fordata=gt.generate_V2D_uc(z_min,strain=strain,resolution=resolution,fn_prefix="./helium-graphene-2D-unit-cell")Here is a visualization of the 2D lookup table.fn="helium-graphene-2D-unit-cell-conventional_V_strain_0.00000_z_2.63624_res_101.npz"data=gt.np.load(fn)mplstylefile='default'withgt.plt.style.context(mplstylefile):fig,ax=gt.plt.subplots(dpi=300)ax.imshow(data["potential"].T,origin="lower",extent=[0,1,0,1])ax.set_xlabel(r"$\hat{A}_m$")ax.set_ylabel(r"$\hat{A}_n$")The 2D potential interaction on the Cartesian plan is generated using theget_V2D()function and takes the generated 2D lookup table as a parameter. Plots of the 2D potential can be generated usingplot_V2D()with the option to include the graphene lattice.# Here we generate 2D potential data on the Cartesian plane by using a generated lookup tablebox_dims=gt.np.array([-3.0,3.0,-3.0,3.0])resolution=201fn="helium-graphene-2D-unit-cell_V_strain_0.00000_z_2.52369_res_101.npz"big_V,big_xy_x,big_xy_y,extent=gt.get_V2D(fn,box_dims,resolution=resolution)V2D_data=(big_V,big_xy_x,big_xy_y,extent)# and plot the data we just generateddpi=300plot_filename="V2D.png"# save plot as this namemplstylefile='default'fig_ax=Nonegraphene_lattice=True# include the graphene latticetry:fig,ax,V2D_data=gt.plot_V2D(fn,box_dims,V2D_data=V2D_data,plot_filename=plot_filename,mplstylefile=mplstylefile,resolution=resolution,dpi=dpi)except:fig,ax,V2D_data=gt.plot_V2D(fn,box_dims,plot_filename=plot_filename,mplstylefile=mplstylefile,resolution=resolution,dpi=dpi)3D potential plot (still a 2D slice)Similar to the 2D methods a 3D plot of the 2D potential slice can be generated usingplot_V3D().# Here we generate 2D potential data on the Cartesian plane by using a generated lookup tablebox_dims=gt.np.array([-3.0,3.0,-3.0,3.0])resolution=201fn="helium-graphene-2D-unit-cell_V_strain_0.00000_z_2.52369_res_101.npz"big_V,big_xy_x,big_xy_y,extent=gt.get_V2D(fn,box_dims,resolution=resolution)V2D_data=(big_V,big_xy_x,big_xy_y,extent)# and plot the data we just generatedfigsize=(16,9)# widescreen!dpi=240# dpi corresponds to 4K imageplot_filename="V3D.png"mplstylefile='default'fig_ax=Nonegraphene_lattice=Truesurf_kwargs={"alpha":0.5,"cmap":"viridis"}try:fig,ax,V2D_data=gt.plot_V3D(fn,box_dims,plot_filename=plot_filename,V2D_data=V2D_data,mplstylefile=mplstylefile,resolution=resolution,dpi=dpi,figsize=figsize,surf_kwargs=surf_kwargs)except:fig,ax,V2D_data=gt.plot_V3D(fn,box_dims,plot_filename=plot_filename,mplstylefile=mplstylefile,resolution=resolution,dpi=dpi,figsize=figsize,surf_kwargs=surf_kwargs)Additional usageSee function documentation to discover additional usage.