Author Topic: question with script  (Read 3343 times)

0 Members and 1 Guest are viewing this topic.

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
question with script
« 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

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 94
    • View Profile
    • QuantumATK at Synopsys
Re: question with script
« Reply #1 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.