QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: jdgayles16 on September 25, 2010, 17:14

Title: question with script
Post by: jdgayles16 on September 25, 2010, 17:14
I try this script from the manual and i get the error, AttributeError: 'list' object has no attribute 'shape'

Code
transmission_spectrum = TransmissionSpectrum(
configuration=device_configuration,
energies=numpy.linspace(-0.5,0.5,10)*eV,
kpoints=MonkhorstPackGrid(3,3,1),
energy_zero_parameter=AverageFermiLevel,
infinitesimal=1e-06*Units.eV
)
# Print out all k-dependent transmission coefficients
data = transmission_spectrum.transmission()
energies = transmission_spectrum.energies()
kpoints = transmission_spectrum.kpoints()
for i in range(data.shape[0]):
print 'Transmission at energy = %12.6f eV' % (energies[i].inUnitsOf(eV))
print ' kx ky transmission '
for j in range(data.shape[1]):
print '%10.4f %10.4f %16.6e' % (kpoints[j][0],kpoints[j][1],data[i][j])
print
Title: Re: question with script
Post by: Anders Blom on September 25, 2010, 19:15
Some things changed in 10.8.1 to be more consistent. If data is a list, then you need to extract an element before you can do "shape". So, I'm guessing data[0].shape[0] might work, but I haven't had time to check it carefully.