Dear Quantumwise staff:
according to the page from
http://quantumwise.com/forum/index.php?topic=2203.msg10537#msg10537i try to do it using atk 14.3, but something wrong with it. the script as follows:
**********************************************
from NanoLanguage import *
import NLEngine
def makeGridValues(datagrid, cell, origin, unit):
n0, n1, n2 = datagrid.shape
gA, gB, gC = cell
u0 = NLEngine.Cartesian3D(gA[0],gA[1],gA[2])
u1 = NLEngine.Cartesian3D(gB[0],gB[1],gB[2])
u2 = NLEngine.Cartesian3D(gC[0],gC[1],gC[2])
cell_origin = NLEngine.Cartesian3D(origin[0],origin[1],origin[2])
grid_descriptor = NLEngine.GridDescriptor(n0,n1,n2,
NLEngine.UnitCell(u0,u1,u2,cell_origin))
grid3d = NLEngine.RealGrid3D(grid_descriptor,
NLEngine.doubleSequenceToRealVector(datagrid.flatten()),True)
return GridValues(grid3d,unit)
bulk_configuration = nlread("C:\Users\kaypu\Desktop/zigzag12-band.nc", BulkConfiguration)[0]
conf = nlread("C:\Users\kaypu\Desktop/zigzag12-band.nc", BulkConfiguration, read_state=False)[0]
dm = bulk_configuration.calculator()._densityMatrixCalculator()
number_of_electrons = int(dm.fermiDistribution().numberOfElectrons())
LUMO = number_of_electrons/2
LLUMO = LUMO+1
# Which state to compute?
spin = Spin.Up
state = LUMO
filename = "bloch_z12_LUMO_up.nc"
# Number of points to sample from G to Z
Nk = 100
density = None
for kz in numpy.linspace(0.2,0.5,Nk):
b = BlochState(bulk_configuration, quantum_number=state, k_point=[0,0,kz], spin=spin)
psi = b.toArray()
if density == None:
density = (psi*psi.conj()).real
else:
density += (psi*psi.conj()).real
cell = conf.bravaisLattice().primitiveVectors().inUnitsOf(Bohr)
origin = conf.bravaisLattice().origin().inUnitsOf(Bohr)
grid = makeGridValues(density,cell,origin,unit = eV/eV)
nlsave(filename, grid)
nlsave(filename, conf)
******************************************************
the wrong message shows as follows:
Traceback (most recent call last):
File "c:\users\kaypu\appdata\local\temp\1676064135181985.py", line 52, in <module>
grid = makeGridValues(density,cell,origin,unit = eV/eV)
File "c:\users\kaypu\appdata\local\temp\1676064135181985.py", line 12, in makeGridValues
u0 = NLEngine.Cartesian3D(gA[0],gA[1],gA[2])
AttributeError: 'module' object has no attribute 'Cartesian3D'
what's wrong with it, i use 2014.3