[Jmol-users] matrices and crystal symmetry operations From: Robert Hanson - 2009-09-07 08:32 Attachments: Message as HTML ```Jmol-developers, Before I forget -- my VPN is down, so I can't show you this, but I'd like to get people thinking about it. I hit on the idea today of being able to manipulate crystal symmetry operations in Jmol. Then I realized that all we needed were a few simple matrix operations and a matrix variable. So now we have 3x3 and 4x4 matrices in Jmol as variables that can be multiplied, inverted, applied to points, and such. They look like this: x = [[1,2,3],[4,5,6],[7,8,9]] (same as in JavaScript, though here we are restricted specifically to 3x3 and 4x4 matrices) This is interesting, because 3x3 matrices are rotations and inversions, and 4x4 matrices are rotations+inversions+translations. So what's really interesting is that by manipulating 4x4 matricies, you can apply *and manipulate* crystal symmetry operations such as rotation-inversions, glide planes, and such. I think it works pretty well: for Jmol 11.9.3: load quartz.cif packed print symop(2) # gives the 4x4 matrix for symmetry operation 2 print symop(-2, "array") # details about the inverse of symmetry operation 2 x = symop(2) # assigns the matrix to a variable y = x * {1/1, 0, 0} # the point in space that the fractional coordinate {1 0 0} maps to print x*x # the symmetry operation applied twice print symop(x*x,"description") # description of that -- something like "C3 axis" draw symop 2 # draw that operation draw symop -2 # draw its inverse draw symop @{symop(2) * symop(2)} # draw its second application and this is the really interesting part: draw symop @{symop(2) * symop(3)} # draw the product of the two operations print symop(symop(2) * symop(3), "description") # its description I'm hoping someone out there in Jmol land is interested in this and will find something interesting to do with it. I'd like to work with someone to perfect it. The first application I can think of is an extension to the symmetry pop-up menu item that would read "all mirror planes" "all glide planes" etc... Bob -- Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave. Northfield, MN 55057 http://www.stolaf.edu/people/hansonr phone: 507-786-3107 If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 ```