In a very recent post, I mentioned an appendix to an article I wrote. I rather like it. The appendix grew out of a little document I put together. That document is longer, vaguer and a little different from the published appendix, and so I am putting it here. Now, the article was written in LaTeX, and this is a website, so I tried running htlatex on the file. It was very complicated:
$ htlatex planes $ firefox planes.html
And it worked. Next thing is to get it into WordPress… Easy enough to cut and paste the HTML code into the window here, but what about all the graphics that were turned into png files?Ah well…bit of manual fiddling. Equations and symbols seem to sit high, and some of the inline equations have been broken into a mix of graphics and characters… still, not too bad. The PDF version is available here.
Planes perpendicular to vectors
Say you have a vector in real space, expressed say in direct lattice terms, for
You may want the reciprocal plane(s) perpendicular to this vector.
Because correlations in a crystal collapse the scattering into features perpendicular to the direction of the correlation. In a normal, fully ordered three dimensions (3D) crystal, this collapsing happens in all three directions, so the scattered intensity coming off the atoms gets concentrated at points, the reciprocal lattice points, usually denoted hkl.
If you have only two dimensional ordering, the scattering is collapsed down in two directions but not the third, giving rise to rods or lines of scattering in reciprocal space (that is, in diffraction space). If there are only one dimensional correlations, the scattering collapses into sheets, that is, it is delocalised in two dimensions and only localised in one dimension (because there are only correlations in one dimension).
In diffuse scattering the crystal is typically long-range ordered in three dimensions, and the diffraction pattern shows nice Bragg peaks (hkl reflections). However, there can also be disorder, for example in the motions of the molecules or the chemical; substitution of one species of atom or molecule for another.
In a molecular crystal, one can sometimes identify a chain of molecules running through the crystal, and interactions within these chains are likely to be much stronger than those within. That tends to mean that the motions of the molecules along the direction of the chain (call that ‘longitudinal’ motion) is highly correlated, while it is not well correlated laterally.
In such a situation, the single crystal diffuse scattering will show ‘sheets’ of scattering perpendicular to the length of the chain.
Then we can say that
and these reciprocal vectors are defined in terms of the direct space vectors like this
and similarly for the other reciprocal vectors. The important thing for us to note is that this means is perpendicular to and . This is important when we go to take dot products later on. The bottom line here is basically the volume of the unit cell, and 2π is just a scalar, so from the point of view of defining the plane that we want, these are not important.
and since we have more variables than we need if we are to satisfy eq. 1, we can arbitrarily set qc⋆ = 0.
and this is useful because, to take the last term on the first line as an example, is perpendicular to ( × ) by the very nature of the cross product. This means that any terms with a repeated vector go to zero. Further, in the remaining terms the vector part is just of the form ⋅ which is the unit cell volume and a constant, which we can also factor out to be left with
which is nice and simple. This is not a surprise but still…
The next step is to find another vector in that plane. This is just , and if we use the same logic but, to make non-collinear with , we choose rb⋆ to be zero, we get an equation analogous to eq. 6. These can be summed up as
Now, in terephthalic acid (TPA), triclinic polymorph of form II, each molecule has a -COOH group at each end. These H-bond strongly with the groups on neighbouring molecules and you get strongly correlated chains of molecules running along the [-111] (direct space) direction. This then suggests that the planes of scattering perpendicular to these chains will extend in the directions
Now, does this work? Figure 1 is some data from TPA, diffuse scattering data measured on a synchrotron. It also shows the reciprocal axes and the white, two-ended arrows show the directions of the diffuse planes and by
counting Bragg spots it can be seen that these agree with the calculation above.
This means that we can ascribe these features to correlations in the displacements of the TPA molecules linked by the -COOH groups.
A Paper! Good God, a Paper: ‘Synchrotron X-ray diffuse scattering from a stable polymorphic material: terephthalic acid, C8H6O4’
I’ve been doing science for a long time, and while I’m in a bit of a career transition at the moment (see here for example), I’ve still got a few fingers in a few pies, and a few pieces of work slowly wending their ways through the system. Most recently, Eric Chan and I put out ‘Synchrotron X-ray diffuse scattering from a stable polymorphic material: terephthalic acid, C8H6O4‘. It’s a paper about the fuzzy, diffuse scattering from two polymorphs of the title compound.
It’s out in Acta Crystallographica Section B: STRUCTURAL SCIENCE, CRYSTAL ENGINEERING AND MATERIALS, a highly reputable but not open access journal, although they do allow authors to self-archive. At the moment, what that means is if you want a copy send me a message and I’ll punt one back to you.
What is terephthalic acid (TPA)? Well, it is a chemical used a lot in industry (plastics and such) and at room temperature it can crystallise out of solution in two forms, called (wait for it) form I and form II. (Well, actually the word ‘form’ is poorly defined in this context, technically, and it’s better to just say ‘polymorph I’ and ‘polymorph II’). In this context, a molecule is polymorphic if it can form more than one crystal structure and these structures can co-exist. Many materials change structure as you heat them up or squash them, but in a polymorphic system separate crystals of the structures can sit there side by side, under the same conditions. In most case, those conditions are room temperature and one atmosphere of pressure.
The two room temperature polymorphs are both triclinic, so of low symmetry. The difference is in how the molecules are arranged relative to each other. In both cases the -COOH groups on the ends of the molecules connect strongly to those on neighbouring molecules, so long chains of molecules form. (In the picture here, the -COOH groups are those at the ends of the molecule consisting of two red (oxygen) atoms, one white (hydrogen) and the grey (carbon) atom attached to the two whites.) These chains are sort of like one dimensional crystals, and then they are stacked up (like logs or a pile of pipes), but you can stack them up with, say, the -COOH in neighbouring chains close together, or you might have the phenyl rings (that is, the hexagon of grey carbon atoms) in one chain adjacent to the -COOH in the next. So in that sort of way you can get different crystal structures depending on how you stack things up.
Anyway, the paper looks at these polymorphs and how they are similar and how they differ. It uses my old ZMC program, which you can download from here (it comes with an example simulation, though not this one I’m talking about now). (That link goes to a paper I wrote and published for an Open Access journal, which I chose specifically so that you could go and download ZMC and everything for free…)
So in doing this I think about the connectivity of the molecule — how do the atoms depend on each other and where does the molecule need to be able to flex and twist? That means I end up drawing diagrams like this one:
That’s exciting, isn’t it? I start at the middle (X) and then each atom is positioned relative to the ones that went before. Here’s another picture (because I happen to have it handy)…. This shows how the atoms were numbered, and how by numbering them correctly and building the molecule up in the right order it is easy to let the -COOH groups spin around.
Here I show typical data. You can see the little white spots — these are the sharp diffraction peaks, Bragg peaks, and they indicate where a lot of X-rays were reflected off the crystal. They are what is used to work out what is usually called the ‘crystal structure’ which consists of the unit cell (the repeating unit) that the crystal is made up from. But you can also see blobs and streaks and stuff, and these are wider (‘diffuse’) features, and these tell us about how the molecules interact and shuffle each other around, and stuff like that.
Anyway, the paper is online now. The DOI link is https://doi.org/10.1107/S2052520616018801. One thing I really like about it is it’s got a mathematical appendix. I always wanted to write an article with a mathematical appendix. I think I might post on that separately.
The AANSS is a great mix of formality and informality, quality science in a relaxed atmosphere. Anyone who has or might or ought to use neutron scattering in their work (and isn’t that all of us, really?) is invited. And here’s a trick: Registration is $50 cheaper for ANBUG members but ANBUG membership is free! So join up!
I have lots of datafiles I want to plot. gnuplot is scriptable. Since I don’t need any fancy output yet — this is data investigation, not manufacture of publication-quality diagrams — I can get multiple plots out quickly by writing a simple (simplish) couple of scripts.
I am sure people who know bash and perl and stuff can do this much better, but this works for me.
I have a wrapper script that simply consists of multiple calls to an inner script. It is here that I select the files I want to plot:
$ cat make_lots_of_plots.sh ./script_auto.sh r_0001_o_xy_TPA_21_Biso4p8_reread.inp ./script_auto.sh r_0001_o_yz_TPA_21_Biso4p8_reread.inp ./script_auto.sh r_0001_o_zx_TPA_21_Biso4p8_reread.inp . . etc . . ./script_auto.sh r_0050_o_yz_TPA_21_Biso4p8_reread.inp ./script_auto.sh r_0050_o_zx_TPA_21_Biso4p8_reread.inp
I know I could do this in a single script, but I like to be able to call the inner one directly if I just want to make one plot. The inner script, script_auto.sh looks like this:
$ cat script_auto.sh epsname=`basename $1 .inp`.eps echo $epsname scriptname=`basename $1 .inp`.gp echo $scriptname echo "set term postscript eps solid enhanced font 'Times,24'" > $scriptname echo $epsname > temp1111 echo 'set output "' > temp2222 echo '"' > temp3333 paste -d '' temp2222 temp1111 temp3333 >> $scriptname echo "set angles degrees; set polar" >> $scriptname echo "set size square" >> $scriptname echo "set xrange [-0.8:0.8]" >> $scriptname echo "set yrange [-0.8:0.8]" >> $scriptname echo $1 > temp1111 echo 'plot "' > temp2222 echo '" w l lw 3' > temp3333 paste -d '' temp2222 temp1111 temp3333 >> $scriptname echo "set output" >> $scriptname echo "set terminal x11" >> $scriptname echo "quit" >> $scriptname cat $scriptname rm temp1111 temp2222 temp3333 gnuplot $scriptname ls -ltrh $epsname
What’s going on here?
epsname=`basename $1 .inp`.eps echo $epsname scriptname=`basename $1 .inp`.gp echo $scriptname
The bit above just uses basename to create the two filenames I need, one for the encapsulated postscript output, and one for the gnuplot script. Then I basically assemble the lines I want to see go into the gnuplot script. Mostly I can just echo stuff into the file, but I have various quote marks within quote marks, and (for simple-minded me) the solution that I know works is to go via the paste command, and write stuff out to little text files. I am sure there are much tidier ways to do this, but this works for me.
paste -d '' temp2222 temp1111 temp3333 >> $scriptname
causes the contents of the temporary files to be pasted together and put into the script, where the delimiter (‘-d‘) is the thing between the single quotes — which is nothing since the quotes are adjacent. This pastes stuff together with no gaps. The things being echoed into the file are gnuplot commands of various kinds.
Then I cat the script to the screen so I can see what it is doing (if I direct the output from the plotting script into a file, this lets me capture the commands I used), then I remove the temporary files, run gnuplot, and list the newly made file.
Clunky, but simple and effective. Useful changes could include outputting to pdf or some other format, and adding a step at the end (perhaps using pdfjoin) to combine all the resulting files in a single file.
Here is a png of the result. The gnuplot formatting could be made much nicer (title is too big, etc), but the overall process can always be improved, so I’m not worried about that. And the fact that it is a script means I can replot quickly when I know what the final format should be. For now I just want to see what I’ve got.
It has long been an intention of mine to take our techniques for exploring the way the atoms are arranged in complicated materials and apply them to superconductors. The crystal structures of the oxide (high-temperature) superconductors are similar to those found in ferroelectric materials, which we have looked at in some detail. The difference is that in ferroelectrics the positions of the atoms relate directly to the interesting properties, since the ferroelectricity arises from atomic displacements (that is, from atoms moving around), whereas in superconductors the useful property shows up in how the electrons behave, and while this must be enabled by the crystal structure, the link is less direct. Even so, it seems to me that if we want to have a good idea of how the properties arise from the structure, then we need to know what the structure is.
One of the high-temperature superconductors is HgBa2CuO4+δ, a classic ‘copper oxide layer’ superconductor, descended from the original high-TC materials discovered in the late 1980s. We found some data on it in the literature, and decided that while the modelling there was a useful place to start, the model that was developed did not really do a great job of mimicking the observed scattering. Hence, we decided to re-analyse their data.
In summary, we find that when the extra oxygen atoms are added to the structure (that’s the ‘+δ’ in the chemical formula), they go into the structure as long strings of atoms, as correctly identified by the authors of the paper with the original data, which is behind a paywall. What we have done that is new is improve the agreement between model and data by adjusting the positions of the surrounding atoms; it makes sense that when you stuff new atoms into a structure, the ones already there have to adjust to accommodate them. Based on things like bond valence sums, we can get some idea of what these adjustments should be, and then create a model crystal in which the atoms are pushed around in sensible ways in response top the added oxygens. These new atomic positions will then influence the environments of other atoms, and of electrons moving through the structure. Here is an image to break up the text:Since the paper is open access, I won’t go into massive detail here, but when it comes to modelling the streaks of scattering in the pattern the results are pretty solid. There are some other, subtle details we continue to work on, but so far I think we can conclude that the methods of Monte Carlo analysis of single crystal diffuse scattering promise to deepen our understanding of superconductors and maybe — maybe! — will help us design ones that work at ever-higher temperatures.
Intel 6th-Gen i7 6700K SSD DDR4 4.0GHz CPU, 16GB DDR4 RAM, 2TB SATA III 6GB/s HDD,N600 Wireless Dual Band PCI-Express Network Adapter with 2 Antennae. (Just a cut and paste from the specs.)
Ordered it from D&D Computer Technology Pty Ltd, and delivery was pretty quick. At my work the standard Linux ‘solution’ is RHEL, so it is running RHEL 6.7 (the IT guys here don’t like 7 — it uses the controversial systemd, for one thing…)
Wireless internet so I can put it wherever I want to.
Compared to our previous generation of boxen (4+ years old), it runs a fairly typical Monte Carlo simulation in 20m55s instead of 27m21s, which is a useful but not massive improvement, which is really the result of code that is really just a single, single-threaded process which results in it scaling more with the clock speed than anything else.
I’ve put LaTeX on the box, but I am going to manage it via TeXLive’s tlmgr rather than RHEL’s package management, so we’ll see how that works out…
Here begins a technicalish, science-y post.
This post is all about a paper we recently published in IUCrJ, here is the link: http://dx.doi.org/10.1107/S2052252515018722.
When X-rays or neutrons scatter off a sample of crystalline powder, the result is a powder diffraction pattern. Usually the intensity of the scatting is measured as a function of the angle of scattering for radiation of a fixed wavelength. The angle can be converted to the more universal ‘scattering vector’:
Now, when analysing a pattern like this, the most common method is Rietveld refinement, in which a possible unit cell is posited, and its diffraction pattern calculated and compared to the observed.
Now, this is very useful indeed, but there are a couple of issues. The first is that this sort of analysis only uses the strong Bragg reflections in the pattern — the big sharp peaks. Mathematically, this means it finds the single body average which is to say that it can show what is going on on each atomic site but not how one site relates to another. For example, it might say that a site has a 50% chance of having an atom of type A on it and 50% of type B, but it can’t say how this influences a neighbouring site. Do A atoms cluster? Do they like to stay apart? This information, if we can get it, tells of the short-range order (SRO) in a crystalline material, where the Bragg peaks tell of the long-range order. SRO is important, interesting, and rather difficult to get a handle on.
Now, the flat, broad (‘diffuse‘) scattering between the Bragg peaks — stuff that looks rather like background, and is often mixed up with background — contains two body information. If the non-sample scattering is carefully removed, then what is left is all the scattering from the sample, and only scattering from the sample. This is called the Total Scattering. This can then be analysed to try to understand what it going on. The most common way of doing that is to calculate the pair distribution function (PDF) from the TS. This essentially shows the probabilities of finding scatterers at different separations — a two-body probability, which helps us ‘get inside’ the average structure that we get from Bragg peak (Rietveld) analysis.
Now, this is all talking about powders. The main issue is that a powder is a collection of randomly oriented crystallites/grains which means the pattern is averaged. Ideally, it would be nice to have a single crystal, to measure the total scattering in a way that is not averaged by random orientation. This is Single Crystal Diffuse Scattering, SCDS. It is (in my opinion) rather a gold standard in structural studies, but is pretty tricky to do…
What the paper we have just published in IUCrJ does is to take a system we have studied using SCDS, and then study it using PDF to show what things the PDF can reasonably be expected to reveal and what features are hidden from it (but apparent in the SCDS). We did this because we felt that PDF, powerful as it is, was perhaps being over-interpreted, and treated as more definitive than it is, and in many cases it is the only viable technique, so it is hard to gauge when it is being over-interpreted. Hence we look at in for a case when it is not the only available method.
What we found was that PDF is very good for showing the magnitudes of the spacings between atoms, and for showing the population of the spacings between atoms, but is not good for showing how these spacings might be correlated (ie, are the closely spaced atoms clustering together?). Similarly, it was not good at showing up the ordering of atoms (…ABABA… vs …AAABBBB… for example).
The PDF is in real space — it is a plot of probability against separation, separation is measured in metres, like distances are measured in the world we experience. The SCDS and the TS exist in reciprocal space, where distances are measured in inverse metres (m-1). Some atomic orderings give rise to features that are highly localised in reciprocal space, so are best explored in that space. Also, if the ordering in question only affects a small section of reciprocal space, and that is getting smeared out by the powder averaging, then it won’t show up very well in TS or then in PDF.
For example, above is a cut of SCDS calculated from an analysis of the PDF, whereas below is our model for the SCDS. Clearly the latter should be a lot better — and it is. No surprise. Now this is not making the PDF fight with one hand tied behind its back, and not setting up a straw man, either. The point it not to show that SCDS is a more definitive measurement, the point is to show what PDF can be expected to tell us, so that when we are studying the many systems that we cannot do with SCDS because we cannot get a single crystal, we know when we are stretching the data too far.
Advances in Condensed Matter Physics is an open access journal. I have published in OA journals before, but I am pretty selective about them. For example IUCrJ is is published by the IUCr, and I strongly believe that their name is a ‘guarantee of quality’ as good as any. The other open access paper was in ISRN Materials Science, which was more of an unknown quantity for me, and being a publisher who seems to have expanded via the OA model, the idea of sending work there initially filled me with skepticism. This rather abated when it turned out they wanted a commissioned article and they were even prepared to pay me for it. I am quite happy with how it turned out. The picture below is not that paper but the new one.
Recently, I got an email from Advances in Condensed Matter Physics asking me for an article. Now, I delete several of these sorts of emails a day, and was about to delete this one when I thought, well, perhaps I should give the publisher — Hindawi, publishers of ISRN Materials Science — a second look. The fact that they were prepared to commission something from me showed (of course) remarkable good taste, and the fact that they were prepared to pay for it (and did) suggested that they have an intention of climbing out of the ruck and mall of crappy OA publishers.
So I reread the email. It appeared that they were prepared to waive the fee. Good start. I then went to the ACMP website and searched for the names and work of some scientists that I respect. And they had indeed published there. The journal has a proper impact factor, even if not especially high, and is not just indexed on google scholar (ie, not really indexed at all) but in proper databases like Web of Science. Okay, so it seems like a real journal.
There was an article I wanted to write, one of a very specific kind. I have been developing and using the ZMC software for modelling diffuse scattering from molecular crystals — looking at subtle orderings in materials to improve understanding of structure and function. The process is non-trivial, and not easy for the novice to get a grip on. So what I wanted to do was create an example of a simulation of a crystal, write a paper about it, then upload a bundle of files (as ‘additional material’) that would let a user recreate the simulation.
This seemed like an ideal opportunity, because the software would then be available and not hidden behind a paywall. Indeed, that is how it has worked out — the simulation (‘supplementary material’) can be downloaded by anyone by going to this page.
So not all OA publishers are alike, but it is important that a prospective author does their research into the journal and makes sure they are credible.
So I am a couple of weeks into a Grad. Dip. (Professional Writing) at University of Canberra… My focus is on editing, which means one of my subjects is called Writing For Young People (?).
So far we’ve worked on ABC books, picture books, and children’s poems.
It’s a long way from diffuse scattering from organic molecular crystals, at least at first glance. Writing for scientists who have PhDs and kids who can’t read is not as different as one might think. The lecturer (Tony Eaton) has been very clear that in a picture book the words must not simply recapitulate the pictures, and that there needs to be a strong focus on the story and a willingness to pare away unnecessary detail, and to rephrase for clarity, and to collaborate and if necessary let the collaborator (illustrator, in the case of a picture book) represent ‘your’ ideas in ways you did not expect, and perhaps don’t even agree with; you need to be able to let go of the work.
When writing a paper I do expend some words drawing out the meaning of the figures, so there is a difference there, but the other exhortations do apply. Precision is important. Also, in both cases it helps to look at the work from a point of view not your own to make sure you have explained enough, but not too much. And in science it is good to be dispassionate enough to let a collaborator reinterpret some data, criticise the reasoning, represent data in a different manner. Both forms combine pictures and words in an attempt to be efficient and clear in their communication.
(I considered titling this posting ‘Blogger makes tenuous linkages in order to generate blog post’, but that applies to most of my entries anyway.)