Author Topic: Why can not I bulid a supercell like this?  (Read 2500 times)

0 Members and 1 Guest are viewing this topic.

Offline xjtumse

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Reputation: 0
    • View Profile
Why can not I bulid a supercell like this?
« on: November 18, 2009, 03:52 »
# Loop over lattice constants
import numpy
for a in numpy.arange(2.0,2.8,0.01):
# Define the unit cell
super_cell = [[ 12.   ,   0.   ,   0.   ],
             [  0.   ,  12.   ,   0.   ],
             [  0.   ,   0.   ,  11.075+2*a]]*Angstrom
# Define elements
elements = [Copper,    Copper,    Copper,    Aluminium,
            Copper,    Copper,    Copper]
# Define coordinates
coordinates = [[  0.        ,   0.        ,   0.        ],
               [  0.        ,   0.        ,   2.215     ],
               [  0.        ,   0.        ,   4.43      ],
               [  0.        ,   0.        ,   4.43+1*a  ],
               [  0.        ,   0.        ,   4.43+2*a  ],
               [  0.        ,   0.        ,   6.645+2*a ],
               [  0.        ,   0.        ,   8.86+2*a  ]]*Angstrom
# Set up the periodic atom configuration
periodic_atom_configuration = PeriodicAtomConfiguration(
    super_cell,
    elements,
    cartesian_coordinates=coordinates
    )

When I run the program, it shows 'expected an indented block'. What does this mean?

Offline nori

  • QuantumATK Guru
  • ****
  • Posts: 122
  • Reputation: 12
    • View Profile
Re: Why can not I bulid a supercell like this?
« Reply #1 on: November 18, 2009, 06:38 »
You should write the python code like "a.py".
"Indentation" part of Python basics in ATK 2008.10 manual will help your understanding.

http://www.quantumwise.com/documents/manuals/ATK-2008.10/chap.pythonbas.html#sect1.pythonbas.indent

Offline xjtumse

  • Regular QuantumATK user
  • **
  • Posts: 8
  • Reputation: 0
    • View Profile
Re: Why can not I bulid a supercell like this?
« Reply #2 on: November 18, 2009, 08:59 »
It does work. Thank you very much!