Hi Albert, On Wed, Mar 14, 2012 at 1:40 PM, Albert DeFusco <[email protected]> wrote: > I am working on writing an input generator for PWScf. The input requires > that user knows the atomic lattice basis and the Bravais lattice or the exact > primitive lattice vectors. I have been playing with SPGLIB in Avogadro to be > able to convert unit cell atoms and lattice vectors into the primitive > lattice and the atomic basis and I am having trouble getting it to work > correctly. Is SPGLIB a good library for this or should I look elsewhere?
SPGlib should work well for this. The other alternative would be to interface with Stokes' FINDSYM code in the ISOTROPY package, but it does not provide a library interface and cannot be included with Avogadro: http://stokes.byu.edu/iso/findsym.html > I have found that when I run a simple C program linked to Avogardo's > libspglib.a, where I use the same atom positions and cell matrix, different > results are obtained from those I can print during Avogadro's call to the > spglib routines. Further, the Cell Matrix reported back to the gui is very > different. The code that the crystallography extension uses is in avospglib.h/cpp in the crystallography extension's subdirectory. I've been able to reproduce your issue -- I've tracked it to the OpenBabel::OBUnitCell::SetData call, for instance: cell->SetData(Avogadro::Eigen2OB(cellMatrix)); OpenBabel::matrix3x3 setCellMat = cell->GetCellMatrix(); in the "applyToMolecule" method ends up with: cellMatrix = 1.5, -1.5, 0 || -1.5, 0, -1.5 || 1.5 1.5 0 setCellMat = 1.5, -1.5, 0 || -1.5, 0, -1.5 || 1.5 1.5 -2.22044604 when I reduce a Fd-3m 3 angstrom cubic cell as in your example. This has worked well in the past for a number of different structures, so I suspect that there is something specific about this structure that is confusing the OBUnitCell::SetData method. I spent some time looking at it, but couldn't track it down. I may have time to work on this later, but it may be a while. Feel free to poke around in the OBUnitCell code to track this down and I'll answer any questions you have to the best of my ability. Hope this helps, Dave > For example, the silicon diamond crystal unit cell is a cubic lattice with 8 > atoms and has Fd-3m (227) space group symmetry. The 8 atoms in fractional > coordinates are listed below. > > Si 0.00000 0.00000 0.00000 > Si 0.00000 0.50000 0.50000 > Si 0.50000 0.50000 0.00000 > Si 0.50000 0.00000 0.50000 > Si 0.75000 0.25000 0.75000 > Si 0.25000 0.25000 0.25000 > Si 0.25000 0.75000 0.75000 > Si 0.75000 0.75000 0.25000 > > In order to make a usable PWScf input I have to generate the primitive > lattice and the atomic basis. A correct PWScf input is show below where > PWScf identifies 48 symmetry operations. > > ATOMIC_POSITIONS > Si 0.00 0.00 0.00 > Si 0.25 0.25 0.25 > CELL_PARAMETERS cubic > -0.500000 0.000000 0.500000 > 0.000000 0.500000 0.500000 > -0.500000 0.500000 0.000000 > > Here "CELL_PARAMETERS" refers to the primitive lattice vectors in fractional > coordinates. > > Since primitive lattice vectors are not unique, there are other possible > solutions. All attempts I have made to generate primitive lattice vectors > and the atomic basis with SPGLIB do not work in PWScf. At best I have been > able make input files that have 8 of the expected 48 symmetry operations. > > > Thanks, > Albert > > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Avogadro-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/avogadro-devel ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Avogadro-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/avogadro-devel
