&GLOBAL
  PROJECT cell_optimization
  RUN_TYPE CELL_OPT
  PRINT_LEVEL LOW
&END GLOBAL
&FORCE_EVAL
  METHOD QS
  STRESS_TENSOR ANALYTICAL
  &DFT
    &QS
      METHOD GPW
      EPS_DEFAULT 1.0E-12
      EXTRAPOLATION USE_GUESS
      EXTRAPOLATION_ORDER 4
    &END QS
    BASIS_SET_FILE_NAME BASIS_MOLOPT
    POTENTIAL_FILE_NAME GTH_POTENTIALS
    &MGRID
      NGRIDS 4
      CUTOFF 400
      REL_CUTOFF 70
    &END MGRID
    &POISSON
      POISSON_SOLVER PERIODIC
      PERIODIC XYZ
    &END POISSON
    &SCF
      SCF_GUESS ATOMIC
      EPS_SCF 1.0E-6
      MAX_SCF 2000
      &OT ON
        MINIMIZER DIIS
        PRECONDITIONER FULL_SINGLE_INVERSE
        ALGORITHM STRICT
      &END OT
    &END SCF  
    &XC
        &XC_FUNCTIONAL PBE
        &END XC_FUNCTIONAL
        &VDW_POTENTIAL
           POTENTIAL_TYPE PAIR_POTENTIAL
           &PAIR_POTENTIAL
             TYPE DFTD3
             CALCULATE_C9_TERM .TRUE.
             REFERENCE_C9_TERM .TRUE.
             LONG_RANGE_CORRECTION .TRUE.
             PARAMETER_FILE_NAME dftd3.dat
             REFERENCE_FUNCTIONAL PBE
             R_CUTOFF 10.0
           &END PAIR_POTENTIAL
        &END VDW_POTENTIAL
    &END XC
#    &PRINT
#       &PDOS
#         NLUMO -1
#         COMPONENTS
         #&LDOS
         #  # Component a 
         #  COMPONENTS
         #  LIST 1..768
         #&END LDOS
#       &END PDOS
#    &END PRINT
  &END DFT
  &SUBSYS
    &CELL
      ABC 12.814   12.532   12.676 
      ANGLES 90.00 90.00 90.00
      PERIODIC XYZ
    &END CELL
    &TOPOLOGY
      COORD_FILE_FORMAT PDB
      COORD_FILE_NAME FAPbI3_2x2x2.pdb
      &CENTER_COORDINATES T
      &END CENTER_COORDINATES
      CONNECTIVITY OFF 
    &END TOPOLOGY
    &KIND Sn
      BASIS_SET DZVP-MOLOPT-SR-GTH
      POTENTIAL GTH-PBE-q4
    &END KIND
    &KIND N
      BASIS_SET DZVP-MOLOPT-GTH
      POTENTIAL GTH-PBE-q5
    &END KIND
    &KIND C
      BASIS_SET DZVP-MOLOPT-GTH
      POTENTIAL GTH-PBE-q4
    &END KIND
    &KIND H
      BASIS_SET DZVP-MOLOPT-GTH
      POTENTIAL GTH-PBE-q1
    &END KIND
    &KIND Pb
      BASIS_SET DZVP-MOLOPT-SR-GTH 
      POTENTIAL GTH-PBE-q4
    &END KIND
    &KIND I
      BASIS_SET DZVP-MOLOPT-SR-GTH
      POTENTIAL GTH-PBE-q7 
    &END KIND
  &END SUBSYS
  &PRINT
    &FORCES OFF
    &END
    &GRID_INFORMATION
    &END
  &END
&END FORCE_EVAL

&MOTION
  &CELL_OPT
  &END CELL_OPT
  &PRINT
   &TRAJECTORY
    FORMAT XYZ
    ADD_LAST NUMERIC
   &END TRAJECTORY
   &CELL
   &END CELL
  &END PRINT
&END MOTION 