<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing ideas tagged with Chemistry sorted by most viewed.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2411604" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/787142" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/131302" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2026904" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2068787" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2115501" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1098055" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3217184" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/201504" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1732535" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/188575" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1190717" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2927764" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1733124" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/828033" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1052348" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/830644" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1390630" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1874816" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/963198" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2411604">
    <title>[WSG21] Daily Study Group: Differential Equations (begins November 29)</title>
    <link>https://community.wolfram.com/groups/-/m/t/2411604</link>
    <description>A new study group devoted to Differential Equations begins next Monday! A list of daily topics can be found on our [Daily Study Groups][1] page. This group will be led by one of our outstanding Wolfram certified instructors, Luke Titus, and will meet daily, Monday to Friday, over the next three weeks. Luke will share the excellent lesson videos created by him for the upcoming Wolfram U course &amp;#034;[Introduction to Differential Equations][2]&amp;#034;. Study group sessions include time for exercises, discussion and Q&amp;amp;A. This study group will help you achieve the &amp;#034;Course Completion&amp;#034; certificate for the &amp;#034;Introduction to Differential Equations&amp;#034; course after you complete the course quizzes.&#xD;
&#xD;
Sign up: [Study group registration page][3]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolfram.com/wolfram-u/special-event/study-groups/&#xD;
  [2]: https://www.wolfram.com/wolfram-u/introduction-to-differential-equations/&#xD;
  [3]: https://www.bigmarker.com/series/daily-study-group-intro-to-differential-equations/series_details?utm_bmcr_source=community</description>
    <dc:creator>Devendra Kapadia</dc:creator>
    <dc:date>2021-11-22T16:35:30Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/787142">
    <title>Crystallica: A package to plot crystal structures</title>
    <link>https://community.wolfram.com/groups/-/m/t/787142</link>
    <description>## General information and download links ##&#xD;
&#xD;
If you&amp;#039;re interested in crystal structures, you can now download the Crystallica application from the Wolfram Library Archive, and then you can do things like this:&#xD;
&#xD;
    Needs[&amp;#034;Crystallica`&amp;#034;];&#xD;
    CrystalPlot[&#xD;
    {{5.4,0,0},{0,5.4,0},{0,0,5.4}},&#xD;
    {{0,0,0},{0,0,.5},{0,.5,0},{.5,0,0},{.24,.24,.24},{.24,.76,.76},{.76,.24,.76},{.76,.76,.24}},&#xD;
    {1,2,2,2,3,3,3,3},&#xD;
    AtomCol-&amp;gt;{&amp;#034;Firebrick&amp;#034;,&amp;#034;YellowGreen&amp;#034;,White},AtomRad-&amp;gt;.4,&#xD;
    BondStyle-&amp;gt;2,BondDist-&amp;gt;3,&#xD;
    CellLineStyle-&amp;gt;False,AddQ-&amp;gt;True,Lighting-&amp;gt;{{&amp;#034;Directional&amp;#034;,White,ImageScaled[{0,0,1}]}},Background-&amp;gt;Black]&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Here are the download links for Crystallica and two other packages you may need:&#xD;
&#xD;
[Crystallica][2] - contains the functions `CrystalPlot` and `CrystalChange`&#xD;
&#xD;
[CifImport][3] - contains an import function for CIF files&#xD;
&#xD;
[VaspImport][4] - contains an import function for files related to [VASP][5]&#xD;
&#xD;
Once you&amp;#039;ve installed Crystallica (by saving the entire Crystallica folder - not the zip archive - to `$USerBaseDirectory/Applications` and re-starting the Kernel), you can enter Crystallica into the Documentation Center and you&amp;#039;ll find lots of useful examples. Most of the examples in this post are taken from the Documentation. For the other two packages, just install them and evaluate this:&#xD;
&#xD;
    ?CifImport&#xD;
    ?VaspImport&#xD;
&#xD;
I&amp;#039;ll first show you a few things the `CrystalPlot` function can do when you already have crystal structure data inside Mathematica, wherever it may have come from. Then we&amp;#039;ll take a look at how to get the data into Mathematica in the first place, which is where `CifImport` and `VaspImport` will come into play - but we&amp;#039;ll get data from other sources as well. I&amp;#039;ll cover the different import solutions in separate replies to this thread, because I have a feeling that I&amp;#039;ll be rambling on and on and on...&#xD;
&#xD;
## Simple plot ##&#xD;
&#xD;
Traditional ball-and-stick plots are usually just fine, so the simplest thing you can do is this:&#xD;
&#xD;
    CrystalPlot[&#xD;
    {{4.5,0,0},{0,4.5,0},{0,0,3}},&#xD;
    {{0,0,0},{.5,.5,.5},{.2,.8,.5},{.3,.3,0},{.7,.7,0},{.8,.2,.5}},&#xD;
    {1,1,2,2,2,2}]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
As you can see, `CrystalPlot` expects three arguments. The first one contains the lattice vectors, which are simply the three vectors that create the parallelepiped that constitutes the cell. The second argument contains the atomic coordinates, but they&amp;#039;re given in the basis of the lattice vectors (which is quite useful in crystallography). The third argument is a list of integers that gives the atom types, with one entry for each atom. If you want to plot a molecule instead, you can call `CrystalPlot` with just two arguments: A list of atom coordinates in cartesian space, and a list of atom types. Everything else you see in the plot - the atoms, bonds, colours, arrows etc. - represents the default settings of various layout options.&#xD;
&#xD;
## Advanced atoms and bonds ##&#xD;
&#xD;
Let&amp;#039;s take a look at some more advanced options just for fun. For instance, atoms and bonds can look any way you need them to, because you can specify your own functions for them. You can also fine-tune where to put bonds and what to do with their thickness and colour in a physically (or chemically) meaningful way, but I won&amp;#039;t show that here. So here are some customized atoms and bonds:&#xD;
&#xD;
    Row[Table[&#xD;
    CrystalPlot[{{4,0,0},{0,4,0},{0,0,4}},{{0,0,0},{.4,.4,.4},{.8,.8,.8}},{1,2,3},&#xD;
    AtomRad-&amp;gt;{.4,1.2,.7},AtomFunction-&amp;gt;style,ImageSize-&amp;gt;400],&#xD;
    {style,{&#xD;
    (Ball[#1,#2]&amp;amp;),&#xD;
    (Scale[Sphere[#1,#2],{1,1,.5}]&amp;amp;),&#xD;
    ({EdgeForm[Thick],Opacity[.7],Cuboid[#1-.5*#2,#1+.5*#2]}&amp;amp;)&#xD;
    }}]]&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
    Row[Table[&#xD;
    CrystalPlot[{{0,0,0},{5,0,0},{2.5,4,0}},{1,2,3},BondDist-&amp;gt;6,BondStyle-&amp;gt;style,ImageSize-&amp;gt;400],&#xD;
    {style,{&#xD;
    1,&#xD;
    Function[{bonds,partcol},Table[{If[ii&amp;lt;.5,partcol[#,1],partcol[#,2]],Sphere[bonds[[#,1]]+ii*(bonds[[#,2]]-bonds[[#,1]]),.15]},{ii,0,1,1/9}]&amp;amp;/@Range[Length[bonds]]],&#xD;
    Function[{bonds,partcol},Module[{spiral,points,rad=.05},&#xD;
    spiral[atoms_]:=Module[{scale=.5,dist=atoms[[2]]-atoms[[1]],curls=60,normal,rot,scaled},&#xD;
    normal=Table[{scale*Cos[ii],scale*Sin[ii],.1*ii},{ii,0,curls,\[Pi]/10}];&#xD;
    scaled={#[[1]],#[[2]],10*Norm[dist]/curls*#[[3]]}&amp;amp;/@normal;&#xD;
    rot=scaled.Quiet[RotationMatrix[{dist,{0,0,1}}]];&#xD;
    Join[{atoms[[1]]},#+atoms[[1]]&amp;amp;/@(rot[[25;;-25]]),{atoms[[2]]}]];&#xD;
    points=spiral/@bonds;&#xD;
    {partcol[#,1],Tube[BSplineCurve[points[[#,;;Round[Length[points[[#]]]/2]]],rad]],partcol[#,2],Tube[BSplineCurve[points[[#,Round[Length[points[[#]]]/2];;]],rad]]}&amp;amp;/@Range[Length[bonds]]&#xD;
    ]]&#xD;
    }}]]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
## Lattice planes ##&#xD;
&#xD;
Crystallica can also add lattice planes to the plot. You can specify them using [h,k,l] Miller indices and distance to the origin.&#xD;
&#xD;
    CrystalPlot[{{3,0,0},{0,3,0},{0,0,3}},{{0,0,0}},{1},&#xD;
    AddQ-&amp;gt;True,AtomRad-&amp;gt;.3,AtomCol-&amp;gt;&amp;#034;CadmiumYellow&amp;#034;,Sysdim-&amp;gt;2,CellLineStyle-&amp;gt;2,&#xD;
    LatticePlanes-&amp;gt;Table[{{1,1,1},dist},{dist,1,5}],ContourStyle-&amp;gt;{&amp;#034;TerreVerte&amp;#034;,Opacity[.7]},BoundaryStyle-&amp;gt;Thick]&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
## Coordination polyhedra ##&#xD;
&#xD;
You can automatically search for and plot coordination polyhedra. This is not limited to the commonly occurring tetrahedra and octahedra - you can actually look for polyhedra with arbitrary numbers of corners. There are also options to fine-tune both the searching and the rendering.&#xD;
&#xD;
    plot[corners_,mixed_]:=CrystalPlot[{{0,0,0},{0,0,1.8},{-.9,-1.5,-.6},{-.9,1.5,-.6},{1.7,0,-.6},{.8,.8,.8}},{1,2,2,2,2,3},&#xD;
    BondStyle-&amp;gt;False,ImageSize-&amp;gt;250,&#xD;
    PolyMode[corners]-&amp;gt;{&amp;#034;Show&amp;#034;-&amp;gt;All,&amp;#034;AllowMixed&amp;#034;-&amp;gt;mixed},PolyStyle[corners]-&amp;gt;Directive[Opacity[.5],EdgeForm[Thick]]];&#xD;
    Grid[{{&#xD;
    &amp;#034;&amp;#034;,&#xD;
    &amp;#034;Search for polyhedra with \n4 corners&amp;#034;,&#xD;
    &amp;#034;Search for polyhedra with \n5 corners&amp;#034;&#xD;
    },{&#xD;
    &amp;#034;Allow \nmixed corners&amp;#034;,&#xD;
    plot[4,True],&#xD;
    plot[5,True]&#xD;
    },{&#xD;
    &amp;#034;Don&amp;#039;t allow \nmixed corners&amp;#034;,&#xD;
    plot[4,False],&#xD;
    plot[5,False]&#xD;
    }},Dividers-&amp;gt;All]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
    CrystalPlot[{{2.5,-4.3,0},{2.5,4.3,0},{0,0,5.5}},&#xD;
    {{.5,0,0},{0,.5,.7},{.5,.5,.3},{.2,.4,.5},{.6,.8,.2},{.2,.8,.8},{.8,.6,.5},{.4,.2,.2},{.8,.2,.8}},{1,1,1,2,2,2,2,2,2},&#xD;
    PolyMode[4]-&amp;gt;True,PolyStyle[4]-&amp;gt;EdgeForm[None],AddQ-&amp;gt;True,&#xD;
    Sysdim-&amp;gt;2,AtomRad-&amp;gt;0,CellLineStyle-&amp;gt;False,AtomCol-&amp;gt;{&amp;#034;SlateGray&amp;#034;,&amp;#034;Firebrick&amp;#034;},&#xD;
    ViewAngle-&amp;gt;.4,ViewPoint-&amp;gt;{3.2,0,1.1},ViewVertical-&amp;gt;{.5,0,1.2}]&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
## Other things ##&#xD;
&#xD;
Visualization aside, you can also build supercells, change cell shapes, or add, remove and sort atoms... but that&amp;#039;s a bit boring to read, so I&amp;#039;ll refer you to the Documentation page of the `CrystalChange` function instead.&#xD;
&#xD;
If you&amp;#039;re interested, we can use this thread to talk about any questions you may have, or you can share your use of the package (if you decide to use it). I&amp;#039;m not offering full support here, but I&amp;#039;ll be floating around, and I&amp;#039;d like to hear your feedback. We don&amp;#039;t have any intentions to be involved in further development. But if you have a good idea and some time, then by all means, work on it for yourself, or host it on your favourite code collaboration site.&#xD;
&#xD;
Bianca Eifert and Christian Heiliger&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=teaser.png&amp;amp;userId=69107&#xD;
  [2]: http://library.wolfram.com/infocenter/MathSource/9372/&#xD;
  [3]: http://library.wolfram.com/infocenter/MathSource/9373/&#xD;
  [4]: http://library.wolfram.com/infocenter/MathSource/9375/&#xD;
  [5]: http://vasp.at/&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=9692simple.png&amp;amp;userId=69107&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=atoms.png&amp;amp;userId=69107&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=bonds.png&amp;amp;userId=69107&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=planes.png&amp;amp;userId=69107&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=polys.png&amp;amp;userId=69107&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=polys2.png&amp;amp;userId=69107&#xD;
  [12]: http://rruff.geo.arizona.edu/AMS/CIF_text_files/13532_cif.txt&#xD;
  [13]: http://cms.mpi.univie.ac.at/vasp/vasp/POSCAR_file.html&#xD;
  [14]: http://wiki.jmol.org/index.php/File:Caffeine.mol</description>
    <dc:creator>Bianca Eifert</dc:creator>
    <dc:date>2016-02-05T18:43:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/131302">
    <title>Plotting electronic orbitals with Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/131302</link>
    <description>I am reposting this here from the [url=http://mathematica.blogoverflow.com/]Stackexchange Mathematica blog[/url] so that more people might see it.  I&amp;#039;d be very happy to get some feedback on this plotting function.  If anyone can use the function, let me know how it works out for you, and if you&amp;#039;d recommend any changes.  If so, I can edit this post to have to most up-to-date version.&#xD;
&#xD;
As a chemist it is often useful to plot electronic orbitals.  These are used to describe the wave function of electrons in atoms or molecules.  Typically, these are output from electronic structure software in the form of a cube file, first developed by Gaussian.  These files contain volumetric data for a given orbital on a three-dimensional grid.&#xD;
&#xD;
&#xD;
There exist many applications to visualize cube files, such as [url=http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/cubeplugin.html]VMD [/url]or [url=http://www.gaussian.com/g_tech/gv5ref/results.htm]GaussView[/url], but I wanted to take advantage of Mathematicas  capability to easily combine graphics, as well as the ability to automate the process in order to efficiently create frames for a [url=http://www.pnas.org/content/suppl/2013/09/05/1308604110.DCSupplemental/sm01.mp4]movie[/url].&#xD;
&#xD;
First off, we need a function to extract the data from the cube file. In the process, we will create the text for an XYZ file, a format also developed by Gaussian. The function [b]OutForm[/b] is used here to mimic the printf function found in other programming languages.&#xD;
&#xD;
[mcode]OutForm[num_?NumericQ, width_Integer, ndig_Integer, &#xD;
   OptionsPattern[]] :=&#xD;
  Module[{mant, exp, val},&#xD;
   {mant, exp} = MantissaExponent[num];&#xD;
   mant = ToString[NumberForm[mant, {ndig, ndig}]];&#xD;
   exp = If[Sign[exp] == -1, &amp;#034;-&amp;#034;, &amp;#034;+&amp;#034;] &amp;lt;&amp;gt; IntegerString[exp, 10, 2];&#xD;
   val = mant &amp;lt;&amp;gt; &amp;#034;E&amp;#034; &amp;lt;&amp;gt; exp;&#xD;
   StringJoin@PadLeft[Characters[val], width, &amp;#034; &amp;#034;]&#xD;
   ];&#xD;
&#xD;
ReadCube[cubeFileName_?StringQ] := Module[&#xD;
   {moltxt, nAtoms, lowerCorner, nx, ny, nz, xstep, ystep, zstep, &#xD;
    atoms, desc1, desc2, xyzText, cubeDat, xgrid, ygrid, zgrid, &#xD;
    dummy1, dummy2, atomicNumber, atomx, atomy, atomz, tmpString, &#xD;
    headerTxt,bohr2angstrom},&#xD;
   bohr2angstrom = 0.529177249;&#xD;
   moltxt = OpenRead[cubeFileName];&#xD;
   desc1 = Read[moltxt, String];&#xD;
   desc2 = Read[moltxt, String];&#xD;
   lowerCorner = {0, 0, 0}; &#xD;
   {nAtoms, lowerCorner[[1]], lowerCorner[[2]], lowerCorner[[3]]} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   xyzText = ToString[nAtoms] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;;&#xD;
   xyzText = xyzText &amp;lt;&amp;gt; desc1 &amp;lt;&amp;gt; desc2 &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;;&#xD;
   {nx, xstep, dummy1, dummy2} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   {ny, dummy1, ystep, dummy2} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   {nz, dummy1, dummy2, zstep} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   Do[&#xD;
    {atomicNumber, dummy1, atomx, atomy, atomz} = &#xD;
     Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
    xyzText = If[Sign[lowerCorner[[1]]] == 1,&#xD;
      xyzText &amp;lt;&amp;gt; ElementData[atomicNumber, &amp;#034;Abbreviation&amp;#034;] &amp;lt;&amp;gt; &#xD;
       OutForm[atomx, 17, 7] &amp;lt;&amp;gt; OutForm[atomy, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[atomz, 17, 7] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;,&#xD;
      xyzText &amp;lt;&amp;gt; ElementData[atomicNumber, &amp;#034;Abbreviation&amp;#034;] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomx, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomy, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomz, 17, 7] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;];&#xD;
    , {nAtoms}];&#xD;
   cubeDat = &#xD;
    Partition[Partition[ReadList[moltxt, Number, nx ny nz], nz], ny];&#xD;
   Close[moltxt];&#xD;
   moltxt = OpenRead[cubeFileName];&#xD;
   headerTxt = Read[moltxt, Table[String, {2 + 4 + nAtoms}]];&#xD;
   Close[moltxt];&#xD;
   headerTxt = StringJoin@Riffle[headerTxt, &amp;#034;\n&amp;#034;];&#xD;
   xgrid = &#xD;
    Range[lowerCorner[[1]], lowerCorner[[1]] + xstep (nx - 1), xstep];&#xD;
   ygrid = &#xD;
    Range[lowerCorner[[2]], lowerCorner[[2]] + ystep (ny - 1), ystep];&#xD;
   zgrid = &#xD;
    Range[lowerCorner[[3]], lowerCorner[[3]] + zstep (nz - 1), zstep];&#xD;
   {cubeDat, xgrid, ygrid, zgrid, xyzText, headerTxt}&#xD;
   ];[/mcode]&#xD;
If you need to create a cube file, then the following function can be used:&#xD;
[mcode]WriteCube[cubeFileName_?StringQ, headerTxt_?StringQ, cubeData_] := &#xD;
 Module[{stream}, &#xD;
  stream = OpenWrite[cubeFileName, FormatType -&amp;gt; FortranForm];&#xD;
  WriteString[stream, headerTxt, &amp;#034;\n&amp;#034;];&#xD;
  Map[WriteString[stream, ##, &amp;#034;\n&amp;#034;] &amp;amp; @@ &#xD;
     Riffle[ScientificForm[#, {3, 4}, &#xD;
         NumberFormat -&amp;gt; (Row[{#1, &amp;#034;E&amp;#034;, If[#3 == &amp;#034;&amp;#034;, &amp;#034;+00&amp;#034;, #3], &#xD;
              &amp;#034;\t&amp;#034;}] &amp;amp;), NumberPadding -&amp;gt; {&amp;#034;&amp;#034;, &amp;#034;0&amp;#034;}, &#xD;
         NumberSigns -&amp;gt; {&amp;#034;-&amp;#034;, &amp;#034; &amp;#034;}] &amp;amp; /@ #, &amp;#034;\n&amp;#034;, {7, -1, 7}] &amp;amp;, &#xD;
   cubeData, {2}];&#xD;
  Close[stream];][/mcode]Next we need the function to plot the orbital,&#xD;
[mcode]CubePlot[{cub_, xg_, yg_, zg_, xyz_}, plotopts : OptionsPattern[]] := &#xD;
   Module[{xyzplot, bohr2picometer, datarange3D, pr},&#xD;
    bohr2picometer = 52.9177249;&#xD;
    datarange3D = &#xD;
      bohr2picometer {{xg[[1]], xg[[-1]]}, {yg[[1]], &#xD;
         yg[[-1]]}, {zg[[1]], zg[[-1]]}};&#xD;
    xyzplot = ImportString[xyz, &amp;#034;XYZ&amp;#034;];&#xD;
    Show[xyzplot, &#xD;
     ListContourPlot3D[Transpose[cub, {3, 2, 1}], &#xD;
       Evaluate[FilterRules[{plotopts}, Options[ListContourPlot3D]]], &#xD;
       Contours -&amp;gt; {-.02, .02}, ContourStyle -&amp;gt; {Blue, Red}, &#xD;
       DataRange -&amp;gt; datarange3D, MeshStyle -&amp;gt; Gray, &#xD;
       Lighting -&amp;gt; {{&amp;#034;Ambient&amp;#034;, White}}], &#xD;
       Evaluate[&#xD;
        FilterRules[{plotopts}, {ViewPoint, ViewVertical, ImageSize}]]]&#xD;
    ];    [/mcode]Lets look at an example.  First we need to read in a cube file, download this cube file and place it in your base directory:  [url=https://dl.dropboxusercontent.com/s/rdsxcnqudn1s76n/cys-MO35.cube]cys-MO35cube[/url]&#xD;
[mcode]{cubedata,xg,yg,zg,xyz,header}= ReadCube[&amp;#034;cys-MO35.cube&amp;#034;];[/mcode]Then plot it via[mcode]CubePlot[{cubedata, xg, yg, zg, xyz}][/mcode][img=width: 300px; height: 291px;]http://mathematica.blogoverflow.com/files/2013/09/pizCq-300x291.jpg[/img]&#xD;
When I want to create a movie file, I want all the images to have exactly the same [b]ViewAngle[/b], [b]ViewPoint[/b], and [b]ViewCenter[/b].  When you give these options to [b]CubePlot[/b], it feeds them directly to the [b]Show[/b] function&#xD;
[mcode]vp = {ViewCenter -&amp;gt; {0.5, 0.5, 0.5}, &#xD;
   ViewPoint -&amp;gt; {1.072, 0.665, -3.13}, &#xD;
   ViewVertical -&amp;gt; {0.443, 0.2477, 1.527}};&#xD;
&#xD;
&#xD;
CubePlot[{cubedata, xg, yg, zg, xyz}, vp][/mcode][img=width: 280px; height: 300px;]http://mathematica.blogoverflow.com/files/2013/09/Q1mjs-280x300.jpg[/img]&#xD;
Finally, you can also give any options that normally go to [b]ListContourPlot3D[/b][mcode]CubePlot[{cubedata, xg, yg, zg, xyz}, vp, &#xD;
 ContourStyle -&amp;gt; {Texture[ExampleData[{&amp;#034;ColorTexture&amp;#034;, &amp;#034;Vavona&amp;#034;}]], &#xD;
   Texture[ExampleData[{&amp;#034;ColorTexture&amp;#034;, &amp;#034;Amboyna&amp;#034;}]]}, &#xD;
 Contours -&amp;gt; {-.015, .015}][/mcode][img=width: 288px; height: 300px;]http://mathematica.blogoverflow.com/files/2013/09/fLyJ7-288x300.jpg[/img]&#xD;
&#xD;
Many thanks to Daniel Healion for the [b]ReadCube[/b] and [b]WriteCube[/b] functions.</description>
    <dc:creator>Jason Biggs</dc:creator>
    <dc:date>2013-09-27T18:35:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2026904">
    <title>[WSS20]Design &amp;amp; Implementation of Data Structure of Crystalline Atomic Data</title>
    <link>https://community.wolfram.com/groups/-/m/t/2026904</link>
    <description>![frontimage][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=imagefront.jpg&amp;amp;userId=1316061&#xD;
  [2]: https://www.wolframcloud.com/obj/88bd85e6-8a15-4fe1-ab85-7da71b0ce10b</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2020-07-14T02:04:22Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2068787">
    <title>Organic Chemistry 2: representing chemical reactions</title>
    <link>https://community.wolfram.com/groups/-/m/t/2068787</link>
    <description>This work is part of series of other posts avaialble here:&#xD;
&#xD;
- 1st post: [Organic Chemistry 1: Modeling Synthesis as Graphs][1]&#xD;
&#xD;
- 3rd post: [Organic Chemistry 3: Progress in Multi-Step Chemical Synthesis][2]&#xD;
&#xD;
----&#xD;
&#xD;
I post this in case anyone is interested in experimenting further along these lines, or in collaborating with me on an organic synthesis related project. This notebook shows my representation of various organic chemical reactions in Wolfram Language.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][3]&#xD;
&#xD;
  [Original]: https://www.wolframcloud.com/obj/wolfram-community/Published/OrgSynProject.nb&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/groups/-/m/t/2073460&#xD;
  [2]: https://community.wolfram.com/groups/-/m/t/2071550&#xD;
  [3]: https://www.wolframcloud.com/obj/d25cd622-0699-461b-8652-425dc974e99d</description>
    <dc:creator>Leonardo Cabana</dc:creator>
    <dc:date>2020-09-01T13:44:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2115501">
    <title>Wolfram Mineral Database - Composition of Different Atomic Elements</title>
    <link>https://community.wolfram.com/groups/-/m/t/2115501</link>
    <description># Proposal:&#xD;
&#xD;
*Wolfram&amp;#039;s mineral database is an interesting resource. In this work I will explore and account for the different chemical elements that are part of each mineral to perform an analysis as a whole. Here, the quantities of each element in each mineral will not be addressed, but only the different atomic elements in each mineral. Also, here in this work I exclude minerals that are formed by only 1 chemical element, that is, I consider only compound minerals. The analysis is done in two parts, the first part is an analysis without taking into account the water that may or may not be in the mineral, that is, the mineral completely dehydrated (only its composition that is linked by covalent bonds etc), the second part I analyze the minerals together with the water. In addition to having obtained a ranking of chemical elements in relation to all available minerals, in the end I get a percentage of how many minerals have oxygen and how many minerals have associated water in their composition.*&#xD;
&#xD;
# Database:&#xD;
&#xD;
Of course, Wolfram&amp;#039;s minerals database does not have all the minerals that exist, but it has a very decent amount, where we can make a very representative analysis. First we take the list of minerals in the database and calculate the number of entities:&#xD;
&#xD;
    minerals = EntityList[Entity[&amp;#034;Mineral&amp;#034;]];&#xD;
    Length@minerals&#xD;
&#xD;
![im1][1]&#xD;
&#xD;
Now we will associate each mineral with its chemical formula and, also obtain all the atomic symbols. This operation can take 2 to 3 hours to complete the download from Wolfram&amp;#039;s servers:&#xD;
&#xD;
    formulas = Map[#[&amp;#034;Formula&amp;#034;] &amp;amp;, minerals];&#xD;
    symbols = &#xD;
      Map[#[&amp;#034;AtomicSymbol&amp;#034;] &amp;amp;, EntityList[EntityClass[&amp;#034;Element&amp;#034;, All]]];&#xD;
&#xD;
To quickly make this information available for later use, we can save the data as an .mx file with the help of DumpSave:&#xD;
&#xD;
    filepath = FileNameJoin[{NotebookDirectory[], &amp;#034;formulas.mx&amp;#034;}];&#xD;
    filepath2 = FileNameJoin[{NotebookDirectory[], &amp;#034;symbols.mx&amp;#034;}];&#xD;
    DumpSave[filepath, {formulas}];&#xD;
    DumpSave[filepath2, {symbols}];&#xD;
    Quit[]&#xD;
&#xD;
That way we can retrieve the data for fast use whenever we want, using Get:&#xD;
&#xD;
    SetDirectory[NotebookDirectory[]];&#xD;
    Get[&amp;#034;formulas.mx&amp;#034;]&#xD;
    Get[&amp;#034;symbols.mx&amp;#034;]&#xD;
&#xD;
The definition of “symbols” below:&#xD;
&#xD;
    symbols&#xD;
&#xD;
![im2][2]&#xD;
&#xD;
Below is a simple function to have each mineral associated with its chemical formula in an easy way to visualize:&#xD;
&#xD;
    threadFormula[m_, n_] := &#xD;
      Thread[minerals[[m ;; n]] -&amp;gt; formulas[[m ;; n]]] // &#xD;
       Grid[Partition[#, 1], Frame -&amp;gt; All, Alignment -&amp;gt; Left] &amp;amp;;&#xD;
    &#xD;
    threadFormula[1000, 1010]&#xD;
&#xD;
![im3][3]&#xD;
&#xD;
# Data Excluding Water:&#xD;
&#xD;
Unfortunately the mineral formulas in the database are in a very complicated format to manipulate, as part is in String, part in Superscript, etc ... so we need to modify and alter the data in an intelligent way to obtain the formulas in a more computable form, at the same time we exclude water associated with minerals that have it:&#xD;
&#xD;
    a1 = {StringDelete[StringDelete[ToString[#], &amp;#034;{&amp;#034;], &amp;#034;}&amp;#034;]} &amp;amp; /@ &#xD;
       Table[Flatten@Apply[List, i, All], {i, formulas}];&#xD;
    a2 = Table[&#xD;
       StringDelete[&#xD;
        a1[[x]], {&amp;#034;(, H, 2, O, )&amp;#034;, &amp;#034;H, 2, O&amp;#034;, &#xD;
         &amp;#034; ScriptBaselineShifts&amp;#034; ~~ __}], {x, 1, Length@a1}];&#xD;
    &#xD;
    a2[[;; 10]]&#xD;
&#xD;
![im4][4]&#xD;
&#xD;
Now extracting the different chemical elements for each mineral and excluding the minerals formed by just one chemical element. Note that the number of minerals went from 3878 to 3778:&#xD;
&#xD;
    a3 = Union[#] &amp;amp; /@ &#xD;
       Flatten[StringCases[#, ReverseSortBy[symbols, Length]] &amp;amp; /@ a2, 1];&#xD;
    a4 = Table[If[Length@a3[[z]] &amp;gt; 1, a3[[z]], Nothing], {z, 1, Length@a3}]&#xD;
    Length@a4&#xD;
&#xD;
![im5][5]&#xD;
&#xD;
Finally, we can count the composition of different atomic elements that are part of all the minerals in the database. We can see that there are 70 different elements in this list:&#xD;
&#xD;
    a5 = Association[Reverse@SortBy[Normal@Counts@Flatten@a4, Last]]&#xD;
    Length@a5&#xD;
&#xD;
![im6][6]&#xD;
&#xD;
We can set up a Dataset with the elements and their position (ranking) that are part of all minerals for better visualization:&#xD;
&#xD;
    Transpose[&#xD;
      Partition[&#xD;
       Keys@# -&amp;gt; &#xD;
          Quantity[Position[Normal@a5, #][[1, 1]], &#xD;
           IndependentUnit[&amp;#034;position&amp;#034;]] &amp;amp; /@ Normal@a5 , 10]] // Dataset&#xD;
&#xD;
![im7][7]&#xD;
&#xD;
For the next parts of this work we have to define the two rules below:&#xD;
&#xD;
    rule1 = Thread[Flatten[Position[symbols, #] &amp;amp; /@ symbols] -&amp;gt; symbols];&#xD;
    rule2 = Join[{0 -&amp;gt; &amp;#034;Water&amp;#034;}, rule1];&#xD;
&#xD;
With some manipulation of the data, we can for example reorganize the elements in the order they are in the periodic table, that is, in the order of the atomic number, as well as other useful lists to create some graphs and analyzes:&#xD;
&#xD;
    b1 = Table[{Sort[Thread[{Keys@a5, Values@a5}]][[x, &#xD;
         1]], {Sort[Thread[{Keys@a5, Values@a5}]][[x, 2]]}}, {x, 1, &#xD;
        Length@a5}];&#xD;
    b2 = Table[&#xD;
       Entity[&amp;#034;Element&amp;#034;, b1[[x, 1]]][&amp;#034;AtomicNumber&amp;#034;], {x, 1, Length@b1}];&#xD;
    b3 = SortBy[Table[{b2[[x]], b1[[x, 2, 1]]}, {x, 1, Length@b2}], First];&#xD;
    b4 = Association@&#xD;
       Table[(b3[[x, 1]] /. rule1) -&amp;gt; b3[[x, 2]], {x, 1, Length@b3}];&#xD;
    b5 = Table[{b3[[x, 1]] /. rule1, b3[[x, 2]]}, {x, 1, Length@b3}];&#xD;
    b4&#xD;
&#xD;
![im8][8]&#xD;
&#xD;
The first plot we have is the different chemical elements that form all the minerals in decreasing order of quantity in which they appear in the whole:&#xD;
&#xD;
    ListPlot[Tooltip /@ a5, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     Axes -&amp;gt; {None, Automatic}, GridLines -&amp;gt; {None, Automatic}]&#xD;
&#xD;
![im9][9]&#xD;
&#xD;
The next plot is the different chemical elements that make up all the mineral samples, but in the order of atomic number. This visualization is interesting because it relates to the periodic table:&#xD;
&#xD;
    ListLinePlot[&#xD;
     Callout[#[[2]], Style[{#}, 10, Red, Bold], CalloutStyle -&amp;gt; Red] &amp;amp; /@ &#xD;
      b5, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     PlotMarkers -&amp;gt; {Automatic, Scaled[0.01]}, &#xD;
     GridLines -&amp;gt; {Table[{x, Dashed}, {x, 1, 70}], None}, &#xD;
     PlotStyle -&amp;gt; Thin]&#xD;
&#xD;
![im10][10]&#xD;
&#xD;
We can view it also in the form of WordCloud:&#xD;
&#xD;
    WordCloud[b5, ImageSize -&amp;gt; Large]&#xD;
&#xD;
![im11][11]&#xD;
&#xD;
# Result of Oxygen:&#xD;
&#xD;
To conclude the initial analysis, we can see in how many percent of the minerals that there is oxygen attached to the molecular structure in relation to all minerals. We see that this value can reach up to 80%:&#xD;
&#xD;
    &amp;#034;OxygenInTotal&amp;#034; -&amp;gt; Quantity[N[100*b4[&amp;#034;O&amp;#034;]/Length@a4], &amp;#034;Percent&amp;#034;]&#xD;
&#xD;
![im12][12]&#xD;
&#xD;
# Data with Water:&#xD;
&#xD;
With some differences in relation to the first part of this work, instead of excluding water, we can define a new water entity to be included in the formula of the minerals that contain it:&#xD;
&#xD;
    a2W = Table[&#xD;
       StringReplace[&#xD;
        a1[[x]], {&amp;#034;(, H, 2, O, )&amp;#034; -&amp;gt; &amp;#034;Water&amp;#034;, &amp;#034;H, 2, O&amp;#034; -&amp;gt; &amp;#034;Water&amp;#034;, &#xD;
         &amp;#034; ScriptBaselineShifts&amp;#034; ~~ __ -&amp;gt; &amp;#034;&amp;#034;}], {x, 1, Length@a1}];&#xD;
    &#xD;
    a2W[[;; 10]]&#xD;
&#xD;
![im13][13]&#xD;
&#xD;
With a similar code, with only a few differences, we do the same extraction of atomic symbols plus water in each mineral. Again, we exclude minerals formed by only 1 chemical element:&#xD;
&#xD;
    a3W = Union[#] &amp;amp; /@ &#xD;
       Flatten[StringCases[#, &#xD;
           ReverseSortBy[Join[symbols, {&amp;#034;Water&amp;#034;}], Length]] &amp;amp; /@ a2W, 1];&#xD;
    a4W = Table[&#xD;
      If[Length@a3W[[z]] &amp;gt; 1, a3W[[z]], Nothing], {z, 1, Length@a3W}]&#xD;
    Length@a4W&#xD;
&#xD;
![im14][14]&#xD;
&#xD;
And, again with some manipulation of the data, we created lists and associations to have the result in quantities (including water). Some of these definitions will also be used below to have some plots:&#xD;
&#xD;
    a5W = Association[Reverse@SortBy[Normal@Counts@Flatten@a4W, Last]];&#xD;
    a5W&#xD;
    Length@a5W&#xD;
    b1W = Table[{Sort[Thread[{Keys@a5W, Values@a5W}]][[x, &#xD;
         1]], {Sort[Thread[{Keys@a5W, Values@a5W}]][[x, 2]]}}, {x, 1, &#xD;
        Length@a5W}];&#xD;
    b2W = Table[&#xD;
        Entity[&amp;#034;Element&amp;#034;, b1W[[x, 1]]][&amp;#034;AtomicNumber&amp;#034;], {x, 1, &#xD;
         Length@b1W}] /. {Missing[&#xD;
          &amp;#034;UnknownEntity&amp;#034;, {&amp;#034;Element&amp;#034;, &amp;#034;Water&amp;#034;}] -&amp;gt; 0};&#xD;
    b3W = SortBy[Table[{b2W[[x]], b1W[[x, 2, 1]]}, {x, 1, Length@b2W}], &#xD;
       First];&#xD;
    b4W = Association@&#xD;
       Table[(b3W[[x, 1]] /. rule2) -&amp;gt; b3W[[x, 2]], {x, 1, Length@b3W}];&#xD;
    b5W = Table[{b3W[[x, 1]] /. rule2, b3W[[x, 2]]}, {x, 1, Length@b3W}];&#xD;
&#xD;
![im15][15]&#xD;
&#xD;
The water being included together with the decreasing order of the amounts of different chemical elements that are part of all minerals:&#xD;
&#xD;
    ListPlot[Tooltip /@ a5W, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     Axes -&amp;gt; {None, Automatic}, GridLines -&amp;gt; {None, Automatic}]&#xD;
&#xD;
![im16][16]&#xD;
&#xD;
A plot similar to that of the first part of the work, in ascending order of atomic number, but including water and it appears before hydrogen (water defined as position 0) just for viewing:&#xD;
&#xD;
    ListLinePlot[&#xD;
     Callout[#[[2]], Style[{#}, 10, Red, Bold], CalloutStyle -&amp;gt; Red] &amp;amp; /@ &#xD;
      b5W, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     PlotMarkers -&amp;gt; {Automatic, Scaled[0.01]}, &#xD;
     GridLines -&amp;gt; {Table[{x, Dashed}, {x, 1, 71}], None}, &#xD;
     PlotStyle -&amp;gt; Thin]&#xD;
&#xD;
![im17][17]&#xD;
&#xD;
Visualization using WordCloud including water:&#xD;
&#xD;
    WordCloud[a5W, ImageSize -&amp;gt; Large]&#xD;
&#xD;
![im18][18]&#xD;
&#xD;
# Result of Water:&#xD;
&#xD;
In the way below we calculate how many percent of minerals have water associated with its composition in relation to all available minerals. We can see that an expressive part of them have water (hydrated minerals), more than 1/3 of them:&#xD;
&#xD;
    &amp;#034;WaterInTotal&amp;#034; -&amp;gt; Quantity[N[100*a5W[&amp;#034;Water&amp;#034;]/Length@a4W], &amp;#034;Percent&amp;#034;]&#xD;
&#xD;
![im19][19]&#xD;
&#xD;
# Conclusion and Notes:&#xD;
&#xD;
- A significant amount of minerals have some oxygen in the chemical composition: 80% of them.&#xD;
&#xD;
- A good part of minerals have water associated with its molecule: 35% of them.&#xD;
&#xD;
It is worth mentioning that there may be some flaws in the exclusion and inclusion of water in the calculations, as for example, some organic minerals and some others may be erroneously influenced by the rules stipulated in this work. But it is a minority of these minerals, so although there is some variation in these percentages the value is satisfactorily approximate.&#xD;
&#xD;
In the future it would be interesting to also analyze the amounts of each chemical element in minerals and not only an analysis as presented here that only counts the different chemical elements. It proved difficult to do this type of analysis because the mineral formulas are in a complex format for computability.&#xD;
&#xD;
My personal opinion is: it is very interesting that in most minerals we can extract oxygen and water (more from the first than the second) with some physical-chemical treatment, sometimes this can be done in a simple way, sometimes in a complex way, but it demonstrates how there is enough oxygen and water inside the earth&amp;#039;s crust, and not only coming from the oceans, from the very formation of our planet.&#xD;
&#xD;
Thanks.&#xD;
&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1513im1.png&amp;amp;userId=1316061&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9107im2.png&amp;amp;userId=1316061&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7916im3.png&amp;amp;userId=1316061&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4965im4.png&amp;amp;userId=1316061&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7193im5.png&amp;amp;userId=1316061&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8332im6.png&amp;amp;userId=1316061&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1159im7.png&amp;amp;userId=1316061&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7568im8.png&amp;amp;userId=1316061&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2146im9.png&amp;amp;userId=1316061&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1588im10.png&amp;amp;userId=1316061&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2712im11.png&amp;amp;userId=1316061&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2750im12.png&amp;amp;userId=1316061&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7119im13.png&amp;amp;userId=1316061&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3232im14.png&amp;amp;userId=1316061&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4654im15.png&amp;amp;userId=1316061&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im16.png&amp;amp;userId=1316061&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im17.png&amp;amp;userId=1316061&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im18.png&amp;amp;userId=1316061&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im19.png&amp;amp;userId=1316061</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2020-11-15T23:14:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1098055">
    <title>The periodic table - powered by Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/1098055</link>
    <description>Recently, I&amp;#039;ve been working on a project called Mandy, an interactive periodic table that displays different element trends depending on what the user says to her.  The Raspberry Pi/Mathematica duo has played a very strong role in all aspects of the project design and implementation.&#xD;
&#xD;
I&amp;#039;m not allowed to provide too many details about the project (not because it&amp;#039;s secret, but because I am moving in a month and my wife has ordered that all of my toys and hobbies get packed or I risk them being left behind).  Therefore, I [created a teaser trailer][2] showcasing the design with a promise to provide more details when I get settled in my new location.&#xD;
&#xD;
[![enter image description here][3]][2]&#xD;
&#xD;
[![enter image description here][4]][2]&#xD;
&#xD;
That said, I wanted to highlight a couple of areas where Mathematica played a pivotal role in the the project.  My goal was to create a periodic table display (approximately 24x18&amp;#034;) that has a RGB LED for each element.  The color of the element would then be based on a given periodic trend (atomic radius, weight, ionization energy, etc.).  Controlling 118 3-color LEDs turns out to be very easy when the LEDs are Neopixels and the controller is an Arduino.  Because I envisioned a wall display, I wanted the user to interact with the piece in some fashion other than a mouse or keyboard.  I have started working on a voice recognition system based on pocketsphinx which I call [Simplified Command and Control - SCAC](https://bobthechemist.com/2015/12/prelude-to-simplified-command-and-control/) but since it is a C/Python project, I&amp;#039;ll leave that component for another forum.  In summary, the final project requires that SCAC (a python script) interact with Mathematica (data manipulation) that then speaks to an Arduino via a serial connection.  But Mathematica played a big role prior to the implementation as well:&#xD;
&#xD;
## Design&#xD;
&#xD;
- With access to `ElementData`, I was able to very quickly create an image that could be sent to a laser cutter for carving the birch-wood frame and the acrylic element pieces.&#xD;
&#xD;
        o = Table[&#xD;
           Map[ElementData[i, #] &amp;amp;, {&amp;#034;AtomicNumber&amp;#034;, &amp;#034;Symbol&amp;#034;, &amp;#034;Period&amp;#034;, &#xD;
             &amp;#034;Group&amp;#034;}], {i, 118}];&#xD;
        (* Need to massage the f-block elements,giving them fake groups and \&#xD;
        periods.Making their periods 9 and 10 with their groups 3 through 16 \&#xD;
        works nicely *)&#xD;
        o[[57 ;; 70]] = Module[{i = 1, rep = Range[3, 16], tmp},&#xD;
           tmp = Select[o, 57 &amp;lt;= #[[1]] &amp;lt;= 70 &amp;amp;] /. {6 -&amp;gt; 9};&#xD;
           tmp /. {Missing[&amp;#034;NotApplicable&amp;#034;] :&amp;gt; rep[[i++]]}];&#xD;
        o[[89 ;; 102]] = Module[{i = 1, rep = Range[3, 16], tmp},&#xD;
           tmp = Select[o, 89 &amp;lt;= #[[1]] &amp;lt;= 102 &amp;amp;] /. {7 -&amp;gt; 10};&#xD;
           tmp /. {Missing[&amp;#034;NotApplicable&amp;#034;] :&amp;gt; rep[[i++]]}];&#xD;
        o = o /. {&amp;#034;Uut&amp;#034; -&amp;gt; &amp;#034;Nh&amp;#034;, &amp;#034;Uup&amp;#034; -&amp;gt; &amp;#034;Mc&amp;#034;, &amp;#034;Uus&amp;#034; -&amp;gt; &amp;#034;Ts&amp;#034;, &amp;#034;Uuo&amp;#034; -&amp;gt; &amp;#034;Og&amp;#034;};&#xD;
        piece = Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}];&#xD;
        Clear[box]&#xD;
        box[array_] := Module[{x, y, m = 10},&#xD;
          {x, y} = array[[{4, 3}]];&#xD;
          {FaceForm[None], EdgeForm[Thin],&#xD;
           Rectangle[{m x, m (10 - y)}, {m (x + 1), m (11 - y)}]&#xD;
           (*Inset[Style[array[[2]],10,Bold],{m (x+0.5),m(10.7-y)}],&#xD;
           Inset[Style[array[[1]],8],{m(x+0.5),m(10.2-y)}]*)}&#xD;
          ]&#xD;
        makePiece[pt_] := GeometricTransformation[&#xD;
           GeometricTransformation[piece, {pt[[1]], 10 - pt[[2]]}*{1.2, 1.2}],&#xD;
           ScalingTransform[{10, 10}]];&#xD;
        ptpuzzle = &#xD;
          Graphics[{EdgeForm[Thin], FaceForm[None], &#xD;
            makePiece /@ o[[All, {4, 3}]]}];&#xD;
        Clear[letters2]&#xD;
        letters2[array_] := Module[{x, y, m = 10},&#xD;
          {x, y} = array[[{4, 3}]];&#xD;
          {FaceForm[None], EdgeForm[Thin],&#xD;
           (*Rectangle[{m x,m(10-y)},{m(x+1),m(11-y)}]*)&#xD;
           Inset[Style[array[[2]], 8, Bold, &#xD;
             FontFamily -&amp;gt; &amp;#034;Cambria Math&amp;#034;], {m (x + 0.45), &#xD;
              m (10.55 - y)}*{1.2, 1.2}],&#xD;
           Inset[Style[array[[1]], 6, &#xD;
             FontFamily -&amp;gt; &amp;#034;Cambria Math&amp;#034;], {m (x + 0.45), m (10.2 - y)}*{1.2,&#xD;
               1.2}]}&#xD;
          ]&#xD;
        ptpuzzlelt = letters2 /@ o // Graphics;&#xD;
        Show[ptpuzzlelt, ptpuzzle, ImageSize -&amp;gt; 600]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
There are easier ways to create a periodic table, but the above method allowed me to create SVG images suitable for tweaking in vector graphics software and cut with the laser cutter.&#xD;
&#xD;
## Data&#xD;
&#xD;
Naturally, `ElementData` can provide the physical and chemical properties of the elements that I want to display on Mandy.  There&amp;#039;s nothing inspiring about this code (grabbing the data, rescaling it and converting values to a corresponding color scheme).  Mathematica provided a useful platform for sandboxing what the trends would look like:&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
## Implementation&#xD;
&#xD;
Since speech recognition (SCAC) is written in Python, I needed to control a Mathematica Kernel from within Python.  I&amp;#039;ve [played with this idea before](https://github.com/bobthechemist/python-mathlink) which results in a functioning platform that is error-intolerant (READ: not ready for prime time).  Communication with the Arduino is done through a &amp;#034;Serial&amp;#034; device instead of the &amp;#034;Arduino&amp;#034; device because I started this project before the latter was working.  That said, it was pretty straightforward to create a Mathematica Package that (a) opens serial communication with the Arduino, (b) Reads in the element-LED data (c) sends a command to the Arduino to light the LEDs.&#xD;
&#xD;
I plan to post more details about the project, including code and design pictures, in due time.  See [my website](https://bobthechemist.com/2017/05/mandy-the-periodic-table-teaser/) for updates.  RIght now, it sounds like I&amp;#039;ve used up my daily allocation of blogging time and have to go pack some boxes.&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=trends.gif&amp;amp;userId=61884&#xD;
  [2]: https://www.youtube.com/watch?v=eI-IgJ3n_RU&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-08-04at7.37.04AM.png&amp;amp;userId=11733&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-08-04at7.37.59AM.png&amp;amp;userId=11733&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture.JPG&amp;amp;userId=61884&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=trends.gif&amp;amp;userId=61884</description>
    <dc:creator>BoB LeSuer</dc:creator>
    <dc:date>2017-05-18T15:11:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3217184">
    <title>[WSRP24] Distributions of shape parameters for randomly generated amino acid sequences</title>
    <link>https://community.wolfram.com/groups/-/m/t/3217184</link>
    <description>![Analyzing Protein Shape Characteristics][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-07-11at5.58.59%E2%80%AFPM.png&amp;amp;userId=3216761&#xD;
  [2]: https://www.wolframcloud.com/obj/d7874cb2-0b6f-4451-8c73-67bb1a147a12</description>
    <dc:creator>Annie Zhu</dc:creator>
    <dc:date>2024-07-11T22:06:58Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/201504">
    <title>Yet another Wolfram/RPi spectrometer - this time with RaspiCam</title>
    <link>https://community.wolfram.com/groups/-/m/t/201504</link>
    <description>Recently, I tried making a visible spectrometer using the Raspberry pi, the camera module and Mathematica.  Details are posted [url=http://www.bobthechemist.com/interactive-chemistry/16-wolfspec-2-0]here[/url], but here&amp;#039;s a brief summary.  The spectrometer is built out of legos and a few components found around my house (and since I&amp;#039;m a Chemistry professor, diffraction gratings and cuvettes are really found around my house).&#xD;
&#xD;
[img=width: 350px; height: 311px;]http://www.bobthechemist.com/images/images/rpi/oldarticles/wolfspec2inst1.png[/img]&#xD;
&#xD;
The light source (in the upper right hand corner) is a white RGB LED.  Immediate to the left is the sample compartment (which unfortunately is just a little too big for a standard sized cuvette).  Next comes a transmission diffraction grating which is a common supply in general physics classes.  I then use a 10x magnifying lens to condense the light onto a business card.  At the bottom right in the picture is the camera module (connected by the white ribbon to my Raspberry Pi and mounted using a hodge-podge of Legos).  The camera is pointed towards the business card.&#xD;
&#xD;
Unlike [url=http://www.bobthechemist.com/interactive-chemistry/15-wolfspec-version-1-0]my first version of a spectrometer[/url], this version doesn&amp;#039;t require any additional GPIO interfacing or MathLink programming; everything can be done within a typical Mathematica notebook without additional packages.  I acquire images using Import and then use ImageTake to grab just the region of interest.  Here are some example images of the empty spectrometer and with three samples: water, green food coloring and red food coloring.&#xD;
[img=width: 500px; height: 61px;]http://www.bobthechemist.com/images/images/rpi/oldarticles/spectrographs.png[/img]&#xD;
 &#xD;
In order to get spectra out of these images, I do 3 things:&#xD;
&#xD;
1. Convert the images into data with ImageData and then average each of the rows&#xD;
2. Convert the y axis into absorbance.&#xD;
3. Calibrate the x axis by assuming that the RGB LED emits red, green and blue light at the expected wavelengths.&#xD;
&#xD;
The code for these steps is fairly straightforward, and demonstrates how easy it is to manipulate Images, process array data rapidly, and perform linear fitting statistics with just a few lines of code.  For the samples above, I ended up with the following spectra:&#xD;
[img=width: 460px; height: 239px;]http://www.bobthechemist.com/images/images/rpi/oldarticles/calibrated.png[/img]&#xD;
The results are decent, given the quick and dirty calibration, the limitations of my source and the lack of any robust alignment of my &amp;#034;optical bench&amp;#034;.  With some modifications, I suspect I can improve the wavelength resolution, although I will probably be limited by the source, which doesn&amp;#039;t have a continuous emission across the visible region of the electromagnetic spectrum.  The system is easy enough to build at home, however, to serve as a spectroscopic tool for science fair experiments or other kitchen chemistry projects.  </description>
    <dc:creator>BoB LeSuer</dc:creator>
    <dc:date>2014-02-17T02:48:24Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1732535">
    <title>[WSC19] A Computational Method to Predict X Ray Diffraction (XRD) Patterns</title>
    <link>https://community.wolfram.com/groups/-/m/t/1732535</link>
    <description>![Predicted vs Experimental Silver XRD Pattern. Experimental plot obtained from: Koohpeima, Fatemeh &amp;amp; Mokhtari, Mohammad &amp;amp; Samaneh, KHALAFI. (2017). The effect of silver nanoparticles on composite shear bond strength to dentin with different adhesion protocols. Journal of Applied Oral Science. 25. 367-373. 10.1590/1678-7757-2016-0391. ][1]&#xD;
&#xD;
## A Computational Method to Predict X Ray Diffraction (XRD) Patterns ##&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
## Background ##&#xD;
&#xD;
Ever wondered how DNA&amp;#039;s double helix structure was discovered? How drugs are investigated? Well, welcome to the world of  X-ray diffraction! 13 Nobel prizes were awarded for developments involving this old but effective technique, in fields ranging from physics to medicine. But, how is it so effective?&#xD;
&#xD;
XRD is a powerful technique employed in various domains of science to determine the chemical makeup and thereby physical properties of various structures. Each lattice structure has its own &amp;#034;XRD fingerprint&amp;#034; which keys scientists in to its chemical makeup. This fingerprint is characterized by peaks with different intensities at different angles. Here is a sample for a face-centered cubic copper lattice structure:&#xD;
&#xD;
![Copper XRD pattern: From X-Ray Diffraction Studies of Copper Nanopowder (arXiv:1003.6068v1 [physics.gen-ph])][2]&#xD;
&#xD;
The first image in this post is a comparison of experimental and predicted results for a Silver crystal structure.&#xD;
&#xD;
However, predicting these fingerprints given little experimental data is a mathematically involved procedure. This summer, as part of the Wolfram High School Summer Camp, I implemented a framework for predicting these fingerprints for various cubic lattice structures.&#xD;
&#xD;
## Creating the Program ##&#xD;
&#xD;
----------&#xD;
## Getting the Bragg Peak Positions ##&#xD;
&#xD;
You might be wondering what the numbers on the top of the peaks mean. These numbers are Miller indices, which are descriptions of the planes in a unit cell that are producing the peaks. The first step is to use these planes to generate the Bragg peak positions:&#xD;
&#xD;
$$d=\frac{a}{\sqrt{h^2+k^2+l^2}}$$&#xD;
$$ \theta =2\arcsin{\left(\frac{\lambda}{2 d}\right)} $$&#xD;
&#xD;
Here, $a$ denotes the lattice constant (length of a side in a cubic unit cell), $(h,k,l)$ denote the Miller indices, and $\lambda$ denotes the wavelength of the X-ray used. This is based on Bragg&amp;#039;s law, see https://demonstrations.wolfram.com/BraggsLaw/ . &#xD;
&#xD;
However, certain $(h,k,l)$ are forbidden in some structures. For example, in a body-centered cubic structure, $ h+k+l$ has to be even. The function `PossiblePlanes` accounts for these and has access to an extensive dataset of compounds and their structures.&#xD;
&#xD;
To make coding easier, a list of associations was made with a certain $\theta$ being the key for a list of $hkl$ values. &#xD;
&#xD;
&#xD;
    grouped[elementlist_, n_] := &#xD;
     GroupBy[ PossiblePlanes[elementlist, n], &#xD;
      1/Sqrt[(#[[1]]^2 + #[[2]]^2 + #[[3]]^2)] &amp;amp;]&#xD;
    &#xD;
    association[elementlist_, n_, wavelength_] := &#xD;
     Sort[MapThread[#1 -&amp;gt; #2 &amp;amp;, {ToTheta[wavelength, elementlist, n], &#xD;
        grouped[elementlist, n] // Values}]]&#xD;
&#xD;
## Atomic Form Factor ##&#xD;
To account for different electron densities, atomic form factors were calculated using a dataset tabulated by the  International Tables for Crystallography: http://it.iucr.org/Cb/ch6o1v0001/.  These form factors vary by angle; shown below is copper:&#xD;
![Copper&amp;#039;s Atomic Form Factor][3]&#xD;
&#xD;
These atomic form factors are then used in the structure factor calculation, which is directly proportional to the square root of intensity. For unary systems, the structure factor calculation is relatively easy. For binary systems, however, the parity of the Miller indices must be taken into account.&#xD;
&#xD;
    evenodd[b_, elementlist_, theta_, w_] := &#xD;
     If[b, Total[atomdata[#, theta, w] &amp;amp; /@ elementlist], &#xD;
      Differences[atomdata[#, theta, w] &amp;amp; /@ elementlist] // First]&#xD;
&#xD;
Here, `atomdata` gives the atomic form factor at a specific point. This function is mapped to a set of True/False (Even or not) values and returns the structure factor. For a face-centered cubic cell, if the parity of $hkl$ is even, then the atomic form factors are summed, but if the parity is odd, the atomic form factors are subtracted.&#xD;
## Multiplicities ##&#xD;
Now, back to the Miller indices. Take a look at the following graphic:&#xD;
&#xD;
![Miller Indices Felix Kling.svg. (n.d.). Retrieved from WikiMedia ][4]&#xD;
&#xD;
You might notice that if we reflect $(100)$ we can get $(010)$ and $(001)$ . We can also get negative indices, usually denoted $\overline{1}$ instead of $-1$. This gives us 6 total planes that are symmetry-equivalent, and correspond to the same peak. Hence, we say that the class of Miller indices $(h00)$ has a multiplicity of 6. These multiplicities range from 6 to 48 for a cubic lattice structure, but can get as low as 2 with less symmetric structures. &#xD;
&#xD;
Therefore, instead of calculating the contributed intensity of each plane, we count them as one plane and multiply the resultant intensity by a specific multiplicity. This multiplicity is then used to calculate peak intensity.&#xD;
## Intensity Calculation ##&#xD;
$$I_{hkl}=\underbrace{\frac{1+\cos^2 (2\theta)}{\sin^2(\theta)}}_{\text{Lorentz Polarization Correction}} \times \ \ \ \ \   \text{Multiplicity}_{hkl}  \ \ \ \times \underbrace{F_{hkl}^2}_{\text{Structure Factor}}$$&#xD;
&#xD;
The Lorentz polarization correction was introduced to improve accuracy and match experimental conditions as X-rays will not be completely polarized at every angle.&#xD;
&#xD;
    intensity[w_, elementlist_, n_] := &#xD;
     Transpose@{(association[Flatten @ elementlist, n, w] // &#xD;
         Keys), (.5 (1 + (Cos[#])^2)/(Sin[#/2]^2 * &#xD;
               Cos[#/2])) &amp;amp; /@ (association[Flatten @ elementlist, n, w] //&#xD;
            Keys) *&#xD;
        (multiplicity /@ (Last /@ (association[Flatten @ elementlist, n, &#xD;
               w] // Values)))*(structurefactor[elementlist, &#xD;
           w, (association[Flatten @ elementlist, n, w])]) ^2 }&#xD;
&#xD;
`intensity` gives a list of Bragg peak positions and their respective intensities using the aforementioned formula. This intensity function is then inputed in a function which finally plots the diffraction pattern.&#xD;
&#xD;
    peak[{theta_, intensity_}] :=  &#xD;
     intensity * Exp[-10000 Pi (t - theta)^2]&#xD;
Where $t$ is the variable to be plotted against.&#xD;
Here is a comparison of the predicted XRD pattern vs the real diffracted pattern for a Copper FCC structure:&#xD;
&#xD;
![Experimental vs. Predicted XRD Pattern][5]&#xD;
&#xD;
The absolute intensities have little use, as relative intensities are primarily used to analyze these patterns. &#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
## Future Research ##&#xD;
&#xD;
For future research, I have many ideas I want to implement. Thanks to Mr. Wolfram, I certainly have a lot to do this summer! Perhaps the most ambitious of my future plans is doing the inverse problem: predicting the lattice structure from a given XRD pattern. &#xD;
## Acknowledgements ##&#xD;
I would like to thank my mentor, Eryn Gillam, for helping me throughout my project. I would also like to thank the other mentors for their help, and Mohammad Bahrami for his lectures. Wolfram Summer Camp truly gave me an outlet to express my creativity in novel ways, and the two weeks I spent here were invaluable. Wolfram Summer Camp gave me a novel perspective on how to approach all aspects of life, and key insight into how computational thinking can change the world. For these reasons and more, I am beyond grateful to have been a part of this camp, and am looking forward to apply my new skills.&#xD;
&#xD;
## Computational Essay ##&#xD;
https://github.com/hamza314/WSS-Template/blob/master/Final%20Project/Final%20Submission/Hamza%20Alsamraee%20WSC19.nb&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=main.PNG&amp;amp;userId=1725111&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=copperrealxrd.png&amp;amp;userId=1725111&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Capture.PNG&amp;amp;userId=1725111&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=360px-Miller_Indices_Felix_Kling.svg.png&amp;amp;userId=1725111&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=dual.PNG&amp;amp;userId=1725111</description>
    <dc:creator>Hamza Alsamraee</dc:creator>
    <dc:date>2019-07-12T00:56:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/188575">
    <title>Adding Vernier (analog) sensors to the Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/188575</link>
    <description>***Note: I have updated this thread with newer installation instructions.  I&amp;#039;ve kept the original post untouched just for reference.***&#xD;
&#xD;
My latest experiement has been to read from the vast array of analog sensors that are made available from [url=http://www.vernier.com/]Vernier[/url].  The company distributes an SDK that makes a lot of the device interaction straightforward, although compiling the SDK on a Raspberry Pi required a little bit of work which I described in a bit more detail here [dead link removed].  As with some of the other projects I&amp;#039;ve played around with, I find it easiest to interact with hardware devices through MathLink and a bit of c code, so I made a few functions that grab device information and make a measurement (in this case, an average of up to 25 measurements within 1 second).  &#xD;
&#xD;
What makes this approach interesting, in my opinion, is that it utilizes what Vernier calls the [url=http://www.vernier.com/products/interfaces/go-link/]Go!Link interface[/url] with provides a USB connection from the Vernier probe to the (in this case) Raspberry Pi.  The Go!Link allows one to make hot-swapable devices; with a Dynamic call to the MathLink functions, I get.&#xD;
&#xD;
[img=width: 400px; height: 190px;]/c/portal/getImageAttachment?filename=golink.gif&amp;amp;userId=61884[/img]&#xD;
Here is a simple interface where I&amp;#039;m swapping out a thermometer, barometer and a CO2 sensor.  The SDK knows the identity of the sensor, the units it uses and has calibration information already set up so getting the sensors up and running in Mathematica was easy (the tricky part was the MathLink code).&#xD;
&#xD;
Naturally, we can make dynamic plots of sensor readings as well:&#xD;
&#xD;
[img=width: 400px; height: 281px;]/c/portal/getImageAttachment?filename=luxplot.gif&amp;amp;userId=61884[/img]&#xD;
&#xD;
Here I&amp;#039;m using Clock to poll a light sensor every 2 seconds and then shining a light source on the sensor.  The 0-value readings are not conditions of no light, but rather times when the sensor reading failed.  At the moment, I&amp;#039;m not sure if that&amp;#039;s a Mathematica or c problem.</description>
    <dc:creator>BoB LeSuer</dc:creator>
    <dc:date>2014-01-22T13:30:39Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1190717">
    <title>The MoleculeViewer package</title>
    <link>https://community.wolfram.com/groups/-/m/t/1190717</link>
    <description>I have just released a package entitled [&amp;#034;MoleculeViewer&amp;#034;][1], whose functionality is exactly what it says on the tin.&#xD;
&#xD;
This package was inspired in part by previous efforts by [@BoB LeSuer][at0] and [@Bianca Eifert][at1]. I took the best parts of [their][2] [packages][3], along with some of the good parts of the built-in molecule renderer, and added a few of my own tweaks. One noticeable tweak would be the depiction of multiple bonds (just like what is done in some physical models), as in the following image:&#xD;
&#xD;
    MoleculeViewer[&amp;#034;thiacloprid&amp;#034;]&#xD;
![thiacloprid][4]&#xD;
&#xD;
The package has a number of other nifty features and auxiliary functions, like highlighting:&#xD;
&#xD;
    MoleculeViewer[&amp;#034;caffeine&amp;#034;, Highlighted -&amp;gt; {&amp;#034;O&amp;#034;, &amp;#034;N&amp;#034; -&amp;gt; Orange}]&#xD;
![caffeine][5]&#xD;
&#xD;
and legends:&#xD;
&#xD;
    MoleculeViewer[RunOpenBabel[GetChemSpider[&amp;#034;calicheamicin&amp;#034;, &amp;#034;InChI&amp;#034;]], PlotLegends -&amp;gt; True]&#xD;
![calicheamicin][6]&#xD;
&#xD;
Before using the package, you will need to install [Open Babel][7] for some of its conversion functionality. Additionally, to use the [ChemSpider][8] search functionality, you will need to [register][9] to obtain an API key.&#xD;
&#xD;
Download the paclet from GitHub and [install in the usual manner][10]. Alternatively, using the technique featured [here][11], evaluate&#xD;
&#xD;
    PacletInstall[&amp;#034;MoleculeViewer&amp;#034;, &amp;#034;Site&amp;#034; -&amp;gt; &amp;#034;http://raw.githubusercontent.com/tpfto/MoleculeViewer/master&amp;#034;]&#xD;
&#xD;
Documentation and a gallery are given as separate notebooks.&#xD;
&#xD;
 [at0]: http://community.wolfram.com/web/bobthechemist&#xD;
 [at1]: http://community.wolfram.com/web/biancaeifert&#xD;
&#xD;
&#xD;
  [1]: https://github.com/tpfto/MoleculeViewer/releases&#xD;
  [2]: https://github.com/biancaeifert/multi-bond-plot&#xD;
  [3]: https://github.com/bobthechemist/molviewer&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=zotu8.png&amp;amp;userId=520181&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=eTaCP.png&amp;amp;userId=520181&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=nlZ63.png&amp;amp;userId=520181&#xD;
  [7]: http://openbabel.org/&#xD;
  [8]: http://www.chemspider.com/&#xD;
  [9]: http://www.chemspider.com/Register.aspx&#xD;
  [10]: https://mathematica.stackexchange.com/a/141888&#xD;
  [11]: https://mathematica.stackexchange.com/questions/155123</description>
    <dc:creator>J. M.</dc:creator>
    <dc:date>2017-09-23T15:31:37Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2927764">
    <title>Introducing the Wolfram ProteinVisualization paclet!</title>
    <link>https://community.wolfram.com/groups/-/m/t/2927764</link>
    <description>![Introducing the Wolfram ProteinVisualization paclet!][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Main2.bmp&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/353c8f22-23af-4a49-b43c-b0b0f1645249</description>
    <dc:creator>Soutick Saha</dc:creator>
    <dc:date>2023-05-31T14:38:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1733124">
    <title>[WSC19] Exploring Lifetime Distributions for Nuclear Isotope Decay Cascades</title>
    <link>https://community.wolfram.com/groups/-/m/t/1733124</link>
    <description>![Bismuth-212 Decaying][1]&#xD;
&#xD;
##Abstract##&#xD;
The goal behind this project was to find a way to successfully showcase the processes behind nuclear decay reactions. Given an isotope, an algorithm was written to generate an automated interactive nuclear decay cascade chart with nodes to represent different isotopes. These nodes also provided the user with a method of visualizing the decay process by analyzing the selected isotopes&amp;#039; branching ratios with respect to half-life as seen above for example. Additionally, a chart was formed that provided information on all of the isotopes present in the nuclear decay cascade outputted. The user is able to use any known isotope compatible with Wolfram&amp;#039;s [IsotopeData][2] function using [natural language inputs][3]. &#xD;
## I. Computing Ratios ##&#xD;
The mathematical foundations of nuclear decay lie in the [Bateman equation][4], proposed and solved by physicists Ernest Rutherford and Harry Bateman respectively. This model utilizes a set of differential equations in order to calculate the shape of exponential graphs that represent how the parent isotope mass gets converted, whether that be for alternative decay modes or chain decays as seen below.&#xD;
&#xD;
$$N_{D}={\frac {N_{1}(0)}{\lambda _{D}}}\sum _{i=1}^{D}\lambda _{i}c_{i}e^{-\lambda _{i}t}\text{ where }   c_{i}=\prod _{j=1,i\neq j}^{D}{\frac {\lambda _{j}}{\lambda _{j}-\lambda _{i}}}$$ &#xD;
While this solution describes a chain reaction for an *n* amount of chain reactions in a row, the program only utilizes a more specific version to describe chain reactions for specifically two-decay chains: $$ {\frac {\mathrm {d} N_{B}}{\mathrm {d} t}}=-\lambda _{B}N_{B}+\lambda _{A}N_{A0}e^{-\lambda _{A}t}$$&#xD;
&#xD;
For the alternate decay modes, I used a set of three equations to derive the correct ratios based on the parent isotope.&#xD;
&#xD;
 1. $N_{A}=N_{A0}e^{-\lambda t}$ &#xD;
 2. $N_{B}=\frac{\lambda_B}{\lambda}N_{A0} \left(1-e^{-\lambda t} \right) $ &#xD;
 3. $N_{C}={\frac {\lambda _{C}}{\lambda }}N_{A0}\left(1-e^{-\lambda t}\right) $, where $\lambda =\lambda _{B}+\lambda _{C}$. &#xD;
&#xD;
I changed the units of the axes to create a more clear visualization that was in terms of percentages and number of half-lives rather than the number of atoms. Later, you can also notice how the branching ratios were used to construct the elegant lines displayed in the graphs. &#xD;
&#xD;
    halfLife[isotope_] := &#xD;
      IsotopeData[isotope, &amp;#034;HalfLife&amp;#034;] // QuantityMagnitude;&#xD;
    decayConstant[isotope_] := &#xD;
      Log[2.]/ IsotopeData[isotope, &amp;#034;HalfLife&amp;#034;] // QuantityMagnitude;&#xD;
    parentDecay[isotope_, t_] := &#xD;
     If[halfLife[isotope] == Infinity, 1, &#xD;
      E^(-decayConstant[isotope] t*halfLife[isotope])]&#xD;
    parentDecay2[isotope1_Entity, t_] := &#xD;
     If[(halfLife[isotope1] == Infinity), 1, E^(-Log[2] t)]&#xD;
    parentDecay4[isotope1_Entity, isotope2_Entity, isotope3_Entity, &#xD;
      isotope4_, t_] := &#xD;
     If[(halfLife[isotope1] == Infinity), 1, E^(-Log[2] t)]&#xD;
    oneDecayA[isotope_, t_] := &#xD;
     If[halfLife[isotope] == Infinity, 0, &#xD;
      1 - E^(-decayConstant[isotope] t*halfLife[isotope])]&#xD;
    oneDecayB[isotope1_, x_, t_] := &#xD;
     IsotopeData[isotope1, &amp;#034;BranchingRatios&amp;#034;][[x]]*(1 - E^(-Log[2] t))&#xD;
&#xD;
##II. Generating Graphics ##&#xD;
There are three major decay patterns that are demonstrated in the program. The first one is one parent radionuclide decaying to two daughter nuclides, another is one parent radionuclide decaying to three daughter nuclides, and the final one models a nuclear decay. We can use the code for the second one as an example to show how the graphic is formed. &#xD;
&#xD;
    decayChart3[isotope_] := Manipulate[&#xD;
         Style[Row[{&#xD;
            Module[{&#xD;
              y = parentDecay2[isotope, NumberOfHalfLifes],&#xD;
              z = oneDecayB[isotope, 1, NumberOfHalfLifes],&#xD;
              w = oneDecayB[isotope, 2, NumberOfHalfLifes],&#xD;
              x = oneDecayB[isotope, 3, NumberOfHalfLifes]},&#xD;
             Plot[{&#xD;
               parentDecay2[isotope, t],&#xD;
               oneDecayB[isotope, 1, t],&#xD;
               oneDecayB[isotope, 2, t],&#xD;
               oneDecayB[isotope, 3, t]}, {t, 0, 10},&#xD;
              PlotRange -&amp;gt; {0, 1}, &#xD;
              PlotLegends -&amp;gt; &#xD;
               Placed[{&amp;#034;Parent Isotope&amp;#034;, &amp;#034;Child Isotope1&amp;#034;, &amp;#034;Child Isotope2&amp;#034;, &#xD;
                 &amp;#034;Child Isotope3&amp;#034;}, Below], &#xD;
              Epilog -&amp;gt; {PointSize[Large], Point[{NumberOfHalfLifes, y}], &#xD;
                Point[{NumberOfHalfLifes, z}], Point[{NumberOfHalfLifes, w}],&#xD;
                 Point[{NumberOfHalfLifes, x}]}, &#xD;
              PlotLabel -&amp;gt; {&amp;#034;Parent Amount: &amp;#034; &amp;lt;&amp;gt; ToString@ (y*100) &amp;lt;&amp;gt; &amp;#034;%&amp;#034;, &#xD;
                &amp;#034;Child1 Amount: &amp;#034; &amp;lt;&amp;gt; ToString@ (z*100) &amp;lt;&amp;gt; &amp;#034;%&amp;#034;, &#xD;
                &amp;#034;Child2 Amount: &amp;#034; &amp;lt;&amp;gt; ToString@ (w*100) &amp;lt;&amp;gt; &amp;#034;%&amp;#034;, &#xD;
                &amp;#034;Child3 Amount: &amp;#034; &amp;lt;&amp;gt; ToString@ (x*100) &amp;lt;&amp;gt; &amp;#034;%&amp;#034;},&#xD;
              ImageSize -&amp;gt; 500]],&#xD;
            blueList[[&#xD;
             Round[100*parentDecay2[isotope, NumberOfHalfLifes]] + 1]],&#xD;
            yellowList[[&#xD;
             Round[100*oneDecayB[isotope, 1, NumberOfHalfLifes]] + 1]],&#xD;
            purpleList[[&#xD;
             Round[100*oneDecayB[isotope, 2, NumberOfHalfLifes]] + 1]],&#xD;
            greenList[[&#xD;
             Round[100*oneDecayB[isotope, 3, NumberOfHalfLifes]] + 1]],&#xD;
            }],&#xD;
          ImageSizeMultipliers -&amp;gt; {0.34, 0.34}],&#xD;
         {NumberOfHalfLifes, 0, 10}]]&#xD;
&#xD;
 Here, we can see the code behind the plots. However, still, need to still generate the graphics that represent the masses behind each of the particles. The different colors represent the parent radionuclides and the daughter nuclides, with the protons and neutrons of the isotopes represented by a collection of spheres at the vertices of dodecaisocahdroncompounds in a three-dimensional volume. &#xD;
&#xD;
    vc = PolyhedronData[&amp;#034;DodecahedronIcosahedronCompound&amp;#034;, &amp;#034;Vertices&amp;#034;];&#xD;
    molecule1 = {RGBColor[0, 68, 105], &#xD;
         GraphicsComplex[#, Table[Sphere[i], {i, Length[#]}]]} &amp;amp;@vc;&#xD;
    molecule2 = {RGBColor[120, 48, 0], &#xD;
         GraphicsComplex[#, Table[Sphere[i], {i, Length[#]}]]} &amp;amp;@vc;&#xD;
    molecule3 = {Hue[0.81, 0.5, 0.84], &#xD;
         GraphicsComplex[#, Table[Sphere[i], {i, Length[#]}]]} &amp;amp;@vc;&#xD;
    molecule4 = {Hue[0.28, 0.85, 0.79], &#xD;
         GraphicsComplex[#, Table[Sphere[i], {i, Length[#]}]]} &amp;amp;@vc;&#xD;
The shapes were then placed in these boxes at random. Because I chose to analyze the amounts in term of percentages, I made a list of 100 elements for each color, ranging from graphics with isotopes of each color in increments ranging to a hundred. &#xD;
&#xD;
    isotopeParent[x_] := &#xD;
      Graphics3D[&#xD;
       Table[GeometricTransformation[#, transform[{0, 0, 0}]] &amp;amp;@ &#xD;
         molecule1, x], Boxed -&amp;gt; False, PlotRange -&amp;gt; {-30, 30}];&#xD;
    isotopeChild[x_] := &#xD;
      Graphics3D[&#xD;
       Table[GeometricTransformation[#, transform[{0, 0, 0}]] &amp;amp;@ &#xD;
         molecule2, x], Boxed -&amp;gt; False, PlotRange -&amp;gt; {-30, 30}];&#xD;
    isotopePurple[x_] := &#xD;
      Graphics3D[&#xD;
       Table[GeometricTransformation[#, transform[{0, 0, 0}]] &amp;amp;@ &#xD;
         molecule3, x], Boxed -&amp;gt; False, PlotRange -&amp;gt; {-30, 30}];&#xD;
    isotopeGreen[x_] := &#xD;
      Graphics3D[&#xD;
       Table[GeometricTransformation[#, transform[{0, 0, 0}]] &amp;amp;@ &#xD;
         molecule4, x], Boxed -&amp;gt; False, PlotRange -&amp;gt; {-30, 30}];&#xD;
&#xD;
Now, the plot generator will output the images correlating to the percentage at a given half-life. Using the example from before, the diagram for a one-parent to a three-child relationship can be modeled as seen below for Bismuth-212: &#xD;
![enter image description here][5]&#xD;
&#xD;
##III. Charts##&#xD;
###Relation Graphs###&#xD;
A relation graph can be used to represent the decay chains. This is because the Wolfram language has the ability to automatically construct charts that have vector connections with the parent isotopes and their respective child isotopes. Writing functions that utilize the Wolfram IsotopeData function helped to write functions that could be used by each node to identify the children isotopes.  &#xD;
&#xD;
    DaughterNuclides[s_List] := &#xD;
      DeleteCases[&#xD;
       Union[Apply[Join, &#xD;
         Map[IsotopeData[#, &amp;#034;DaughterNuclides&amp;#034;] &amp;amp;, &#xD;
          DeleteCases[s, _Missing]]]], _Missing];&#xD;
    ReachableNuclides[s_List] := &#xD;
      FixedPoint[Union[Join[#, DaughterNuclides[#]]] &amp;amp;, s];&#xD;
    DaughterNuclidesQ[s1_,  s2_] := (s1 =!= s2 &amp;amp;&amp;amp; MemberQ[DaughterNuclides[{s1}], s2]);&#xD;
    children[x_Entity] := ReachableNuclides[{x}]&#xD;
    getSymbol[isotope_] := IsotopeData[isotope, &amp;#034;Symbol&amp;#034;]&#xD;
    decaySymbols[isotope_] := getSymbol[#] &amp;amp; /@ children[isotope]&#xD;
&#xD;
Next, I created an autogenerating vertex label system which takes an isotope makes connections between different nodes. &#xD;
&#xD;
    makeVertexLabels[isotope_] := &#xD;
     Table[children[isotope][[i]] -&amp;gt; decaySymbols[isotope][[i]], {i, 1, &#xD;
       Length@decaySymbols[isotope]}]&#xD;
By combing these methods, the below function makes the decay chart with any given isotope in the Wolfram database. &#xD;
&#xD;
    RelationGraph[DaughterNuclidesQ, children[isotope],&#xD;
     Sequence[VertexLabels -&amp;gt; makeVertexLabels[isotope],&#xD;
      PlotRangePadding -&amp;gt; 0.65, ImageSize -&amp;gt; 300, &#xD;
      PlotTheme -&amp;gt; &amp;#034;Scientific&amp;#034;]]&#xD;
###Information Chart###&#xD;
The information chart works along with the relation tree in the same overall function. It is a table that uses the IsotopeData function to post decay statistics and type for all child isotopes of the parent molecule. &#xD;
&#xD;
    makeChart[isotope_] := &#xD;
     Text[Grid[&#xD;
       Prepend[Table[&#xD;
           IsotopeData[#, &#xD;
            prop], {prop, {&amp;#034;Symbol&amp;#034;, &amp;#034;HalfLife&amp;#034;, &amp;#034;BindingEnergy&amp;#034;, &#xD;
             &amp;#034;DecayModes&amp;#034;}}] &amp;amp; /@ children[isotope], {&amp;#034;symbol&amp;#034;, &#xD;
         &amp;#034;half-life&amp;#034;, &amp;#034;binding energy&amp;#034;, &amp;#034;decay modes&amp;#034;}], Frame -&amp;gt; All, &#xD;
       Background -&amp;gt; {None, {{{LightBlue, White}}, {1 -&amp;gt; LightYellow}}}]]&#xD;
&#xD;
The below function puts everything together and generates an output. We can use the Uranium-232 as an example isotope entity.&#xD;
&#xD;
    makeDecayGraphSample[isotope_] := &#xD;
     Row[{RelationGraph[DaughterNuclidesQ, children[isotope],&#xD;
        Sequence[VertexLabels -&amp;gt; makeVertexLabels[isotope],&#xD;
         PlotRangePadding -&amp;gt; 0.65, ImageSize -&amp;gt; 300, &#xD;
         PlotTheme -&amp;gt; &amp;#034;Scientific&amp;#034;]], makeChart[isotope]}]&#xD;
![enter image description here][6]&#xD;
&#xD;
##IV. Button Integration##&#xD;
The buttons at the place of the nodes serve to integrate part two with the rest of the program. I made a function that looks at each isotope and then decides what type of chart it should be used it depending on the number of children isotopes. &#xD;
&#xD;
    graphf[isotope_] :=&#xD;
     If[Length@DeleteMissing@IsotopeData[isotope, &amp;#034;DaughterNuclides&amp;#034;] == &#xD;
       1, decayChart4[isotope],&#xD;
      If[Length@DeleteMissing@IsotopeData[isotope, &amp;#034;DaughterNuclides&amp;#034;] == &#xD;
        2, decayChart2[isotope],&#xD;
       If[Length@DeleteMissing@IsotopeData[isotope, &amp;#034;DaughterNuclides&amp;#034;] ==&#xD;
          3, decayChart3[isotope],&#xD;
        Return[&amp;#034;&amp;#034;]]]]&#xD;
    vertexGenerate[{xc_, yc_}, vertex_, {w_, h_}] :=&#xD;
      Inset[&#xD;
       Button[&#xD;
        vertex,&#xD;
        currentChart = graphf[vertex]],&#xD;
       {xc, yc}];&#xD;
Using this, I modified the original relationship graph function to depict the updated *vertexGenerate* function to combine all the different sections of the code in one function. &#xD;
&#xD;
    makeDecayGraph[isotope_] := Module[{graph, currentChart = {}},&#xD;
      vertexGenerate[{xc_, yc_}, vertex_, {w_, h_}] :=&#xD;
       Inset[&#xD;
        Button[&#xD;
         vertex,&#xD;
         currentChart = graphf[vertex]],&#xD;
        {xc, yc}];&#xD;
      graph = RelationGraph[DaughterNuclidesQ, children[isotope],&#xD;
        Sequence[VertexLabels -&amp;gt; None,&#xD;
         PlotRangePadding -&amp;gt; 0.65, ImageSize -&amp;gt; 800, &#xD;
         PlotTheme -&amp;gt; &amp;#034;Scientific&amp;#034;, &#xD;
         VertexShapeFunction -&amp;gt; vertexGenerate]];&#xD;
      Column[{graph, Dynamic[currentChart]}]&#xD;
      ]&#xD;
This resulted in a final output that, for demonstration, inputs the Uranium-232 isotope (with the Bismuth-212 button pressed). &#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
##Future Extensions##&#xD;
Some possible extensions that this program could have is making n-chain reaction functions. The program currently doesnt fully exploit the differential recursive functions outlined in the Bateman model. This way, for any potential given chain process, all the successive decays would be calculated. The graphical representations of the decay shown with the molecules behavior over a certain number of half-lives could be updated to showcase a variety of more animations that help explain the behavior of the decay pattern.&#xD;
&#xD;
###Github###&#xD;
&#xD;
----------&#xD;
[https://github.com/srangan24/WSS-Template][8]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=bismut212.gif&amp;amp;userId=1725131&#xD;
  [2]: https://reference.wolfram.com/language/ref/IsotopeData.html&#xD;
  [3]: http://www.wolfram.com/language/fast-introduction-for-programmers/en/natural-language-input/&#xD;
  [4]: https://web-docs.gsi.de/~wolle/TELEKOLLEG/KERN/LECTURE/Fraser/L4.pdf&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.49.30AM.png&amp;amp;userId=1725131&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at7.43.48PM.png&amp;amp;userId=1725131&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at11.54.22AM.png&amp;amp;userId=1725131&#xD;
  [8]: https://github.com/srangan24/WSS-Template</description>
    <dc:creator>Srinath Rangan</dc:creator>
    <dc:date>2019-07-12T01:53:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/828033">
    <title>It&amp;#039;s raining crystal structures: Cloud-based VASP viewer</title>
    <link>https://community.wolfram.com/groups/-/m/t/828033</link>
    <description>You may remember that I&amp;#039;ve already posted [packages for crystal structure plots][1]. I just wanted to dump a piece of code here that&amp;#039;s based on these packages and will let you plot crystal structures from [VASP][2] input/output files on a webpage... in case anyone else is using VASP.&#xD;
&#xD;
For anyone who wants to try the app but doesn&amp;#039;t have a VASP file handy, here&amp;#039;s a sample you can copy and paste into a plain text file:&#xD;
&#xD;
    Rutile&#xD;
       1.00000000000000     &#xD;
         4.5937300000000000    0.0000000000000000    0.0000000000000000&#xD;
         0.0000000000000000    4.5937300000000000    0.0000000000000000&#xD;
         0.0000000000000000    0.0000000000000000    2.9581200000000000&#xD;
       Ti    O&#xD;
         2     4&#xD;
    Direct&#xD;
      0.0000000000000000  0.0000000000000000  0.0000000000000000&#xD;
      0.5000000000000000  0.5000000000000000  0.5000000000000000&#xD;
      0.3053000000000000  0.3053000000000000  0.0000000000000000&#xD;
      0.6947000000000000  0.6947000000000000  0.0000000000000000&#xD;
      0.8053000000000000  0.1947000000000000  0.5000000000000000&#xD;
      0.1947000000000000  0.8053000000000000  0.5000000000000000&#xD;
    &#xD;
The actual code is below the image. Have fun!&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
    CloudDeploy[FormFunction[{&#xD;
       {{&amp;#034;file&amp;#034;, &amp;#034;Upload a VASP POSCAR or CONTCAR file here:&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;UploadedFile&amp;#034;|&amp;gt;}, {&#xD;
        {&amp;#034;sysdim&amp;#034;, &amp;#034;Periodic repetitions&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &#xD;
           Restricted[&#xD;
            DelimitedSequence[&amp;#034;Integer&amp;#034;, &#xD;
             &amp;#034; &amp;#034; | &amp;#034;,&amp;#034; | &amp;#034;;&amp;#034; | &amp;#034;/&amp;#034; | &amp;#034;x&amp;#034; | &amp;#034;X&amp;#034;], 3], &amp;#034;Input&amp;#034; -&amp;gt; &amp;#034;1x1x1&amp;#034;|&amp;gt;,&#xD;
        {&amp;#034;retractq&amp;#034;, &amp;#034;Retract atoms to cell?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;addq&amp;#034;, &amp;#034;Add periodic duplicates of atoms?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;atomrad&amp;#034;, &amp;#034;Atom radius&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; 0.4|&amp;gt;,&#xD;
        {&amp;#034;bonddist&amp;#034;, &amp;#034;Maximum bond length&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; 2.1|&amp;gt;,&#xD;
        {&amp;#034;monobond&amp;#034;, &amp;#034;Want to pick your own bond color?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;bondcol&amp;#034;, &amp;#034;Bond color&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedColor&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; GrayLevel[.8]|&amp;gt;,&#xD;
        {&amp;#034;bondrad&amp;#034;, &amp;#034;Bond radius&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; 0.1|&amp;gt;,&#xD;
        {&amp;#034;linecol&amp;#034;, &amp;#034;Cell outline color&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedColor&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; Black|&amp;gt;,&#xD;
        {&amp;#034;linerad&amp;#034;, &amp;#034;Cell outline radius&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; 0.02|&amp;gt;&#xD;
        }},&#xD;
      &#xD;
      Module[{file, sysdim, retractq, addq, atomrad, bonddist, monobond, &#xD;
         bondcol, bondrad, linecol, linerad,&#xD;
         data, speciesQ, atomcol, chemoffset, chgoffset, lattscale, &#xD;
         lattvec, coord, conf, coordP, confP, new, tubearrow, lines, &#xD;
         atoms, tuples, bonds},&#xD;
        &#xD;
        file = #file;&#xD;
        sysdim = #sysdim;&#xD;
        retractq = #retractq;&#xD;
        addq = #addq;&#xD;
        atomrad = #atomrad;&#xD;
        bonddist = #bonddist;&#xD;
        monobond = #monobond;&#xD;
        bondcol = #bondcol;&#xD;
        bondrad = #bondrad;&#xD;
        linecol = #linecol;&#xD;
        linerad = #linerad;&#xD;
        &#xD;
        (*import: *)&#xD;
        data = Import[file, &amp;#034;Table&amp;#034;];&#xD;
        (*offset if chemical species are given: *)&#xD;
        speciesQ = MatchQ[data[[6]], {_String ..}];&#xD;
        atomcol[type_] := &#xD;
         If[speciesQ, ColorData[&amp;#034;Atoms&amp;#034;, data[[6, type]]], &#xD;
          ColorData[97, type]];&#xD;
        chemoffset = If[speciesQ, 1, 0];&#xD;
        (*offset for missing &amp;#034;Selective Dynamics&amp;#034; line as is common in \&#xD;
    CHG/CHGCAR: *)&#xD;
        chgoffset = &#xD;
         If[TrueQ[Length[data[[chemoffset + 8]]] &amp;gt; 0] &amp;amp;&amp;amp; &#xD;
           MatchQ[data[[chemoffset + 8, 1]], _?NumericQ], -1, 0];&#xD;
        &#xD;
        (*lattice vectors and atoms: *)&#xD;
        lattvec = data[[3 ;; 5]];&#xD;
        lattscale = data[[2]];&#xD;
        If[TrueQ[Length[lattscale] == 1], lattscale = lattscale[[1]]];&#xD;
        If[TrueQ[Sign[lattscale] == -1], &#xD;
         lattscale = (-lattscale/Det[lattvec])^(1/3)];&#xD;
        lattvec = &#xD;
         If[TrueQ[Length[lattscale] == 3], &#xD;
          N[lattscale[[#]]*lattvec[[#]]] &amp;amp; /@ Range[3], &#xD;
          N[lattscale*lattvec]];&#xD;
        conf = &#xD;
         Flatten[Join[&#xD;
           ConstantArray[#, data[[chemoffset + 6, #]]] &amp;amp; /@ &#xD;
            Range[Length[data[[chemoffset + 6]]]]]];&#xD;
        coord = &#xD;
         N[data[[chemoffset + chgoffset + &#xD;
              9 ;; (chemoffset + chgoffset + 8 + &#xD;
               Total[data[[chemoffset + 6]]]), 1 ;; 3]]];&#xD;
        &#xD;
        (*reprojection for cartesian coordinates: *)&#xD;
        If[TrueQ[Length[data[[chemoffset + chgoffset + 8]]] &amp;gt; 0] &amp;amp;&amp;amp; &#xD;
          StringMatchQ[ToString[data[[chemoffset + chgoffset + 8, 1]]], &#xD;
           &amp;#034;c*&amp;#034; | &amp;#034;k*&amp;#034;, IgnoreCase -&amp;gt; True],&#xD;
         If[TrueQ[Length[lattscale] == 3], coord = #*lattscale &amp;amp; /@ coord,&#xD;
           coord = coord*lattscale];&#xD;
         coord = coord.Inverse[lattvec]];&#xD;
        {coordP, confP} = {coord, conf};&#xD;
        &#xD;
        (*retraction, moving all atoms back into the cell: *)&#xD;
        If[retractq, With[{retracttol = 10^-4},&#xD;
          coordP = &#xD;
           Partition[&#xD;
            If[# &amp;gt; (1 - retracttol), # - 1, #] &amp;amp; /@ &#xD;
             Flatten[# - Floor[#] &amp;amp; /@ coordP], 3];&#xD;
          new = DeleteDuplicates[Transpose[{coordP, confP}],&#xD;
            (Norm[&#xD;
                 Round[#1[[1]], retracttol] - Round[#2[[1]], retracttol] -&#xD;
                   Floor[Round[#1[[1]], retracttol]] + &#xD;
                  Floor[Round[#2[[1]], retracttol]]] &amp;lt; &#xD;
                retracttol) &amp;amp;&amp;amp; (#1[[2]] == #2[[2]]) &amp;amp;];&#xD;
          {coordP, confP} = Transpose[new]]];&#xD;
        &#xD;
        (*periodic repetition: *)&#xD;
        coordP = &#xD;
         Flatten[Table[(# + {a, b, c}) &amp;amp; /@ coordP, {a, 0, &#xD;
            sysdim[[1]] - 1}, {b, 0, sysdim[[2]] - 1}, {c, 0, &#xD;
            sysdim[[3]] - 1}], 3];&#xD;
        confP = Flatten[ConstantArray[confP, Times @@ sysdim]];&#xD;
        &#xD;
        (*add peridic duplicates if desired: *)&#xD;
        If[TrueQ[addq],&#xD;
         new = Transpose[{coordP, confP}];&#xD;
         new = &#xD;
          Join[new, # + {{sysdim[[1]], 0, 0}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 1]]] &amp;lt; 0.01 &amp;amp;], # + {{-sysdim[[1]], 0, 0}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 1]]] &amp;gt; 0.99*sysdim[[1]] &amp;amp;]];&#xD;
         new = &#xD;
          Join[new, # + {{0, sysdim[[2]], 0}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 2]]] &amp;lt; 0.01 &amp;amp;], # + {{0, -sysdim[[2]], 0}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 2]]] &amp;gt; 0.99*sysdim[[2]] &amp;amp;]];&#xD;
         new = &#xD;
          Join[new, # + {{0, 0, sysdim[[3]]}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 3]]] &amp;lt; 0.01 &amp;amp;], # + {{0, 0, -sysdim[[3]]}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 3]]] &amp;gt; 0.99*sysdim[[3]] &amp;amp;]];&#xD;
         {coordP, confP} = Transpose[new];&#xD;
         ];&#xD;
        &#xD;
        (*cell lines: *)&#xD;
        tubearrow[{tail_, head_}] := &#xD;
         With[{scale = .5*Sqrt[Mean[Norm /@ lattvec]*linerad]},&#xD;
          Tube[{tail, head - 4*scale*Normalize[head - tail], &#xD;
            head - 4*scale*Normalize[head - tail], head}, {linerad, &#xD;
            linerad, scale, 0}]];&#xD;
        lines = {linecol, Tube[#.lattvec, linerad] &amp;amp; /@ {&#xD;
            {{0, 0, #}, {1, 0, #}, {1, 1, #}, {0, 1, #}, {0, &#xD;
                0, #}} &amp;amp; /@ {0, 1},&#xD;
            {{0, 0, #} &amp;amp; /@ {0, 1}, {1, 0, #} &amp;amp; /@ {0, &#xD;
               1}, {1, 1, #} &amp;amp; /@ {0, 1}, {0, 1, #} &amp;amp; /@ {0, 1}}&#xD;
            }, tubearrow[{{0, 0, 0}, #}] &amp;amp; /@ lattvec};&#xD;
        &#xD;
        (*atoms: *)&#xD;
        atoms = &#xD;
         Tooltip[{atomcol[confP[[#]]], &#xD;
             Sphere[coordP[[#]].lattvec, atomrad]}, #] &amp;amp; /@ &#xD;
          Range[Length[confP]];&#xD;
        &#xD;
        (*bonds: *)&#xD;
        tuples = &#xD;
         Select[Subsets[Range[Length[confP]], {2}], &#xD;
          Norm[(coordP[[#]].lattvec)[[1]] - (coordP[[#]].lattvec)[[2]]] &amp;lt; &#xD;
            bonddist &amp;amp;];&#xD;
        bonds = If[TrueQ[tuples == {}], {},&#xD;
          If[monobond,&#xD;
             {bondcol, Tube[coordP[[#]].lattvec, bondrad]},&#xD;
             Table[{atomcol[confP[[#[[ii]]]]], &#xD;
               Tube[{coordP[[#[[ii]]]].lattvec, &#xD;
                 Total[coordP[[#]].lattvec]*.5}, bondrad]}, {ii, 1, 2}]&#xD;
             ] &amp;amp; /@ tuples];&#xD;
        &#xD;
        (*return the plot: *)&#xD;
        Graphics3D[{lines, bonds, atoms}, ImageSize -&amp;gt; Large, &#xD;
         BaseStyle -&amp;gt; {Specularity[Gray, 100]}, Boxed -&amp;gt; False, &#xD;
         SphericalRegion -&amp;gt; True, Lighting -&amp;gt; &amp;#034;Neutral&amp;#034;]&#xD;
        ]&#xD;
       &amp;amp;, &amp;#034;PNG&amp;#034;, &#xD;
      AppearanceRules -&amp;gt; &amp;lt;|&#xD;
        &amp;#034;Title&amp;#034; -&amp;gt; &amp;#034;Crystal Structure Viewer for VASP&amp;#034;|&amp;gt;], &#xD;
     Permissions -&amp;gt; &amp;#034;Public&amp;#034;]&#xD;
&#xD;
&#xD;
 [at0]: http://community.wolfram.com/web/chrishaydock137&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com/groups/-/m/t/787142&#xD;
  [2]: http://vasp.at/&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=sdf4562y4thrwbdfva.gif&amp;amp;userId=11733</description>
    <dc:creator>Bianca Eifert</dc:creator>
    <dc:date>2016-03-23T08:59:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1052348">
    <title>Calculating NMR-spectra with Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/1052348</link>
    <description>#Introduction&#xD;
&#xD;
Perhaps there are already Mma-Procedures to calculate NMR-spectra, but I did not do a literature research.&#xD;
&#xD;
I post a notebook to calculate NMR-Spectra of simple spin I = 1/2 systems.&#xD;
&#xD;
The notebook comes in two parts. &#xD;
&#xD;
Part one uses a spin-product function approach, where the spin-product function a, a ,...b is used as e.g. phi [ 1, 1, ,...., -1 ]. &#xD;
The Hamiltonian is constructed according to different mT-values and the spectrum is calculated.&#xD;
&#xD;
Part two uses the &amp;#034;brute force&amp;#034; approach where all operators are mapped unto matrices (Kronecker-Products of individual matrix-operators) in the total spin-space. So here products of operators are matrix-products (in part 1 they are functions of functions) .Having the Hamiltonian and its Eigensystem the spectrum is calculated.&#xD;
&#xD;
Note that the number of lines of even small systems are growing rapidly. So it may well be that there is not enough memory to cope with a system you would like to consider.&#xD;
&#xD;
If you omit giving numbers to frequencies and coupling-constants you may get pure theoretical results. That works fine for two spins, but already for three spins - although here you will still get the Hamiltonian - very large outputs are generated, especially in the Eigensystems, So you should avoid that.&#xD;
&#xD;
It seems to be not too complicated to modify the approach in part two to include spins with I &amp;gt; 1/2.&#xD;
&#xD;
And certainly it is well possible to modify the code as to get an iterative procedure to fit data to spectra.&#xD;
&#xD;
I am aware that there are &amp;#034;professional&amp;#034; systems to do all this, but I just wanted to see how it could be done in Mathematica.&#xD;
#Part 1#&#xD;
Number of Spins&#xD;
&#xD;
    nsp = 3;&#xD;
Input of Parameters&#xD;
&#xD;
    freqs = {372.2, 364.4, 342, 6.083, 5.8};&#xD;
    JJ = ( {&#xD;
        {0, .91, 17.9, 1, 1, 1},&#xD;
        {0, 0, 11.75, 1, 1, 1},&#xD;
        {0, 0, 0, 1, 1, 1},&#xD;
        {0, 0, 0, 0, 1, 1},&#xD;
        {0, 0, 0, 0, 0, 1},&#xD;
        {0, 0, 0, 0, 0, 0}&#xD;
       } );&#xD;
    Do[\[Nu][i] = freqs[[i]], {i, 1, nsp}];&#xD;
    Do[J[i, k] = JJ[[i, k]], {i, 1, nsp - 1}, {k, i + 1, nsp}];&#xD;
&#xD;
Basevectors&#xD;
&#xD;
    base = Apply[\[CurlyPhi], &#xD;
      IntegerDigits[#, 2, nsp] + 1 &amp;amp; /@ Table[j, {j, 0, 2^nsp - 1}] /. &#xD;
       2 -&amp;gt; -1, {1}]&#xD;
![enter image description here][1]&#xD;
&#xD;
mT - Values&#xD;
&#xD;
    mT = Table[-nsp/2 + j, {j, 0, nsp}]&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
Number of lines in the spectrum  (  =  Sum[Binomial[nsp, k] Binomial[nsp, k + 1], {k, 0, nsp - 1}],  because only transitions between states of different mT&amp;#039;s give lines on non-zero intensity )&#xD;
&#xD;
    numberoflines = Binomial[2 nsp, nsp - 1]&#xD;
&#xD;
&amp;gt; 15&#xD;
&#xD;
Rule for scalar products&#xD;
&#xD;
    rscp = {\[CurlyPhi][x__]^2 -&amp;gt; 1, \[CurlyPhi][x__] \[CurlyPhi][y__] -&amp;gt;  0}&#xD;
![enter image description here][3]&#xD;
&#xD;
SpinOperators&#xD;
&#xD;
    cs[a_, j_] := Module[{t}, t = a; b = t[[j]]; t[[j]] = -b; t]&#xD;
    Ix[v_, j_] := v/2 /. \[CurlyPhi][x___] :&amp;gt; \[CurlyPhi] @@ cs[{x}, j]&#xD;
    Iy[v_, j_] := &#xD;
     I v/2 /. \[CurlyPhi][x___] :&amp;gt; {x}[[j]] \[CurlyPhi] @@ cs[{x}, j]&#xD;
    Iz[v_, j_] := v/2 /. \[CurlyPhi][x___] :&amp;gt; {x}[[j]] \[CurlyPhi][x]&#xD;
&#xD;
Example&#xD;
&#xD;
    {Ix[\[CurlyPhi][4], 1], Ix[\[CurlyPhi][-1], 1], Iy[\[CurlyPhi][5], 1],&#xD;
      Iy[\[CurlyPhi][-1], 1], Iz[\[CurlyPhi][6], 1], &#xD;
     Iz[\[CurlyPhi][-1], 1]}&#xD;
![enter image description here][7]&#xD;
&#xD;
Hamiltonian  - Matrixelements  Subscript[H, i,j]  for (sub-)base b&#xD;
&#xD;
    HH[b_, i_,  j_] := (Sum[\[Nu][m] b[[j]] Iz[b[[i]], m], {m, 1, nsp}] + &#xD;
         Sum[J[m, k] b[[&#xD;
            j]] (Ix[Ix[b[[i]], k], m] + Iy[Iy[b[[i]], k], m] + &#xD;
             Iz[Iz[b[[i]], k], m]), {m, 1, nsp - 1}, {k, m + 1, nsp}] // &#xD;
        Expand) /. rscp&#xD;
Example&#xD;
&#xD;
    HH[base, 1, 1]&#xD;
&#xD;
&amp;gt; 546.94&#xD;
&#xD;
    HH[base, 1, 2]&#xD;
&#xD;
&amp;gt; 0&#xD;
&#xD;
    HH[base, 3, 5]&#xD;
&#xD;
&amp;gt; 0.455&#xD;
&#xD;
Spinfunctions according to mT - value &#xD;
&#xD;
    wf = Function[x, Select[base, Total[List @@ #] == 2 x &amp;amp;]] /@ mT&#xD;
![enter image description here][8]&#xD;
&#xD;
Hamilton - Submatrices&#xD;
&#xD;
    HSM[j_] := (nn = Length[wf[[j]]]; &#xD;
      Table[HH[wf[[j]], m, n], {m, 1, nn}, {n, 1, nn}])&#xD;
    HSM[2];&#xD;
    % // MatrixForm&#xD;
![enter image description here][9]&#xD;
&#xD;
    HSM[2] /. {\[Nu][10] -&amp;gt; -\[Nu], \[Nu][11] -&amp;gt; 0, \[Nu][12] -&amp;gt; \[Nu], &#xD;
       J[1, 2] -&amp;gt; J, J[1, 3] -&amp;gt; J, J[2, 3] -&amp;gt; J};&#xD;
      % // MatrixForm&#xD;
![enter image description here][13]&#xD;
&#xD;
Get Eigenstates  \[Congruent] all sets { freq,  eigenvector  } for different spin-states (mT values)&#xD;
&#xD;
    frevec[n_] := Module[{es},&#xD;
      es = Eigensystem[HSM[n]];&#xD;
      {#[[1]], #[[2]].wf[[n]]} &amp;amp; /@ Transpose[es]&#xD;
      ]&#xD;
    eigenstates = frevec /@ Range[nsp + 1]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Operator for calculating relative intensities&#xD;
&#xD;
    IOP[x_] := Sum[Ix[x, n], {n, 1, nsp}]&#xD;
Calculating a spectral line  = difference of eigenvalues and intensity&#xD;
&#xD;
    line[a_, b_] := Module[{},&#xD;
      freq = Abs[a[[1]] - b[[1]]];&#xD;
      m2 = (Expand[a[[2]] IOP[b[[2]]]] /. rscp)^2;&#xD;
      {freq, Sqrt[m2]}]&#xD;
Lorentzfunction&#xD;
&#xD;
    LF[x_, x0_, a_, h_] := Module[{},&#xD;
      If[h == 0, h = 1];&#xD;
      1/Sqrt[Pi] (a h/2)/(h^2/4 + Pi (x - x0)^2)]&#xD;
Calculating the spectrum&#xD;
&#xD;
    spec = Table[0, {numberoflines}];&#xD;
    nL = 0;&#xD;
    Do[&#xD;
      lk = Length[eigenstates[[i]]];&#xD;
      lk1 = Length[eigenstates[[i + 1]]];&#xD;
      Do[&#xD;
       Do[&#xD;
        nL = nL + 1;&#xD;
        spec[[nL]] = line[eigenstates[[i, m]], eigenstates[[i + 1, n ]]],&#xD;
        {n, 1, lk1}&#xD;
        ],&#xD;
       {m, 1, lk}&#xD;
       ],&#xD;
      {i, 1, Length[eigenstates] - 1}];&#xD;
    normalizer = Max[Transpose[spec][[2]]];&#xD;
    bb = {.95 Min[Transpose[spec][[1]]], 1.05 Max[Transpose[spec][[1]]]};&#xD;
    spec = {#[[1]], #[[2]]/normalizer} &amp;amp; /@ spec;&#xD;
    spec&#xD;
    pl1 = ListPlot[spec, Filling -&amp;gt; Axis]&#xD;
![enter image description here][15]&#xD;
&#xD;
Show the spectrum with lines&#xD;
&#xD;
    pl2 = Plot[&#xD;
      Plus @@ (LF[x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec), {x, bb[[1]], &#xD;
       bb[[2]]}, PlotRange -&amp;gt; All, AxesOrigin -&amp;gt; {320, 0}]&#xD;
![enter image description here][16]&#xD;
&#xD;
For some physical reason spectra are recorded so that frequencies grow from right to left. So the plot is reversed and compared to the experimental spectrum ( see http://www.users.csbsju.edu/~frioux/nmr/Speclab4.htm ) which is given below the plot.&#xD;
&#xD;
    pl3 = Plot[&#xD;
      Plus @@ (LF[-x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec), {x, -bb[[2]], -bb[[&#xD;
         1]]}, PlotRange -&amp;gt; All]&#xD;
![enter image description here][17]&#xD;
#Part 2#&#xD;
&#xD;
    nsp = 3;&#xD;
Input of Parameters&#xD;
&#xD;
    freqs = {372.2, 364.4, 342, 6.083, 5.8};&#xD;
    JJ = ( {&#xD;
        {0, .91, 17.9, 1, 1, 1},&#xD;
        {0, 0, 11.75, 1, 1, 1},&#xD;
        {0, 0, 0, 1, 1, 1},&#xD;
        {0, 0, 0, 0, 1, 1},&#xD;
        {0, 0, 0, 0, 0, 1},&#xD;
        {0, 0, 0, 0, 0, 0}&#xD;
       } );&#xD;
    Do[\[Nu][i] = freqs[[i]], {i, 1, nsp}];&#xD;
    Do[J[i, k] = JJ[[i, k]], {i, 1, nsp - 1}, {k, i + 1, nsp}];&#xD;
number of lines to be expected and dimension ot (total) spin - space (at least for spin 1/2 )&#xD;
&#xD;
    numberoflines = Binomial[2 nsp, nsp - 1]&#xD;
    dimspsp = 2^nsp&#xD;
&#xD;
&amp;gt; 15&#xD;
&#xD;
&amp;gt; 8&#xD;
&#xD;
spin operators for spin I = 1/2&#xD;
&#xD;
    ix = ( { {0, 1}, {1, 0} } )/2;&#xD;
    iy = ( { {0, -I}, {I, 0} } )/2;&#xD;
    iz = ( {{1, 0}, {0, -1} } )/2;&#xD;
&#xD;
this function constructs the spin operator of particle j as matrix in the spin space of n particles &#xD;
&#xD;
    Op[op_, n_, j_] := Module[{x, m},&#xD;
      x = Join[Table[{{1, 0}, {0, 1}}, {j - 1}], {op}, &#xD;
        Table[{{1, 0}, {0, 1}}, {n - j}]];&#xD;
      m = SparseArray[KroneckerProduct[Sequence @@ x]]&#xD;
      ]&#xD;
    oIx[j_] := Op[ix, nsp, j]&#xD;
    oIy[j_] := Op[iy, nsp, j]&#xD;
    oIz[j_] := Op[iz, nsp, j]&#xD;
&#xD;
Hamiltonian&#xD;
&#xD;
    HH = \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(nsp\)]\(\[Nu][i] oIz[&#xD;
         i]\)\) + \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(nsp - 1\)]\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(j = i + 1\), \(nsp\)]J[i, &#xD;
          j] \((oIx[i] . oIx[j] + oIy[i] . oIy[j] + oIz[i] . oIz[j])\)\)\)&#xD;
&#xD;
&amp;gt; SparseArray[SequenceForm[&amp;#034;&amp;lt;&amp;#034;, 32, &amp;#034;&amp;gt;&amp;#034;], {8, 8}]&#xD;
&#xD;
Eigensystem for the Hamilton - Operator&#xD;
&#xD;
    est = Transpose[Eigensystem[HH]]&#xD;
![enter image description here][18]&#xD;
&#xD;
Intensity operator&#xD;
&#xD;
    IOP1 = \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(j = 1\), \(nsp\)]\(oIx[j]\)\)&#xD;
&#xD;
&amp;gt; SparseArray[SequenceForm[&amp;#034;&amp;lt;&amp;#034;, 24, &amp;#034;&amp;gt;&amp;#034;], {8, 8}]&#xD;
&#xD;
    line1[a_, b_] := Module[{},&#xD;
      freq = Abs[a[[1]] - b[[1]]];&#xD;
      m2 = (a[[2]].IOP1.b[[2]])^2;&#xD;
      {freq, Sqrt[m2]}]&#xD;
&#xD;
Calculate spectrum, show it and display result from part 1&#xD;
&#xD;
    spec1 = Table[0, {Binomial[dimspsp, 2]}];&#xD;
    nL = 0;&#xD;
    Do[&#xD;
     Do[&#xD;
      nL = nL + 1;&#xD;
      spec1[[nL]] = line1[est[[u]], est[[v]]],&#xD;
      {u, v + 1, dimspsp}&#xD;
      ],&#xD;
     {v, 1, dimspsp - 1}&#xD;
     ]&#xD;
    spec1 = Select[spec1, #[[2]] &amp;gt; 0. &amp;amp;];&#xD;
    normalizer = Max[Transpose[spec1][[2]]];&#xD;
    bb = {.95 Min[Transpose[spec][[1]]], 1.05 Max[Transpose[spec][[1]]]};&#xD;
    spec1 = {#[[1]], #[[2]]/normalizer} &amp;amp; /@ spec1;&#xD;
    spec1&#xD;
    ListPlot[spec1, Filling -&amp;gt; Axis, FillingStyle -&amp;gt; Directive[Red, Thick]]&#xD;
    Show[pl1]&#xD;
![enter image description here][19]&#xD;
&#xD;
Plot the spectrum and compare with the result of the 1 st part&#xD;
&#xD;
    pl4 = Plot[&#xD;
      Plus @@ (LF[x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec1), {x, bb[[1]], &#xD;
       bb[[2]]}, PlotRange -&amp;gt; All, PlotStyle -&amp;gt; Red]&#xD;
    Show[pl2]&#xD;
![enter image description here][20]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.23.20.png&amp;amp;userId=95400&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.25.36.png&amp;amp;userId=95400&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.28.10.png&amp;amp;userId=95400&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.32.12.png&amp;amp;userId=95400&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.33.44.png&amp;amp;userId=95400&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.23.20.png&amp;amp;userId=95400&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.25.36.png&amp;amp;userId=95400&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.34.56.png&amp;amp;userId=95400&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.37.59.png&amp;amp;userId=95400&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.41.13.png&amp;amp;userId=95400&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.42.24.png&amp;amp;userId=95400&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.43.26.png&amp;amp;userId=95400&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.50.48.png&amp;amp;userId=95400&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.53.45.png&amp;amp;userId=95400&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.55.25.png&amp;amp;userId=95400</description>
    <dc:creator>Hans Dolhaine</dc:creator>
    <dc:date>2017-04-04T08:36:27Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/830644">
    <title>A Vernier Go!Link package for Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/830644</link>
    <description>*Note: This post is originally from [my website](https://bobthechemist.com/2016/03/a-vernier-golink-package-for-mathematica/), but I thought it might be of interest to some WC readers as well.*&#xD;
&#xD;
The [Go! Link](http://www.vernier.com/products/interfaces/go-link/) from Vernier Software &amp;amp;amp; Technology (Vernier), is a USB adapter for their proprietary sensors which also provides some basic features such as a buffer, sensor auto-identification and raw voltage reading conversion. &#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Vernier provides a [software development kit](http://www.vernier.com/downloads/software-development-kits/go-sdk/) which allows programmers to use Go! devices in their own systems. I often think about how one can build a flexible sensor system using Vernier&amp;#039;s products and based on the inexpensive Raspberry Pi computer and the powerful data analysis and visualization tools of *Mathematica*. This project isn&amp;#039;t new, and my [earlier attempts](https://www.raspberrypi.org/blog/vernier-sensors-and-the-wolfram-language/) were highlighted on the Raspberry Pi blog and I [recently announced](https://bobthechemist.com/2016/03/goiolink-release-candidate-1/) a previous version of this software package. What I&amp;#039;m presenting now is a more user-friendly system that makes data collection easy through the [device driver framework](http://reference.wolfram.com/language/tutorial/DevelopingDeviceDrivers.html) incorporated into *Mathematica*.&#xD;
&#xD;
##Getting Started&#xD;
In addition to the [Go! Link](http://www.vernier.com/products/interfaces/go-link/) adapter, you&amp;#039;ll need at least one of the 66 sensors that are compatible with the adapter. I do most of my Raspberry Pi work on a v2 unit, so I know it works on this version.  The graphical interface for *Mathematica* is very clunky on RPi&amp;#039;s earlier than a v2, but sensor reading can be done with the command line interface (via *wolfram*) using this package as well.&#xD;
&#xD;
The source code can be downloaded from my [project page on Github](https://github.com/bobthechemist/goiolink) and since this post is based on version 1.1 of the software, it is probably best to download the relevant files directly from the [release page](https://github.com/bobthechemist/goiolink/releases/tag/v1.1.0) for this version. Installation instructions are provided there, so I won&amp;#039;t repeat it here.&#xD;
&#xD;
##Basic Operation&#xD;
There are two basic methods for accessing sensor information: one is through the device *framework* and the other is through the device *properties*. I assume most users will jump back and forth between these two methods. The framework consists of the `Device*` functions in *Mathematica*: `DeviceOpen`, `DeviceRead`, `DeviceReadBuffer`, and `DeviceConfigure`. (There are a few other `Device*` commands, but I don&amp;#039;t use them in this package.) Once the software has been installed, starting a sensor session is as easy as starting *Mathematica* and in a new notebook running:&#xD;
&#xD;
    &amp;lt;&amp;lt;GoIO`&#xD;
    d = DeviceOpen[&amp;#034;GoIO&amp;#034;]&#xD;
&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
 Once a connection is established, `DeviceRead[&amp;#034;GoIO&amp;#034;]` can be used to read an average of all the sensor readings currently in the buffer or `DeviceReadBuffer[&amp;#034;GoIO&amp;#034;]` will print a list containing all values currently in the buffer. The default measurement period is 0.040 seconds and the buffer can store 1000 values. If you want to change the measurement period, it can be done with `DeviceConfigure[&amp;#034;GoIO&amp;#034;, {&amp;#034;MeasurementPeriod&amp;#034; -&amp;gt; 1}]`. Presently, the software does not automatically detect if the user changes the sensor, and a call to `DeviceConfigure[&amp;#034;GoIO&amp;#034;]` is necessary when the sensor is switched. &#xD;
&#xD;
 The device has several properties, which can be found using the commands `d[&amp;#034;Properties&amp;#034;]` and `d[&amp;#034;NativeProperties&amp;#034;]`. (Note. `d` is the symbol used in the `DeviceOpen` command mentioned above, and could be something different if you desire.) Properties such as `d[&amp;#034;Read&amp;#034;]` and `d[&amp;#034;ReadAll&amp;#034;]` do the same as the framework functions, but with properties, it is possible to figure out the name of the sensor (`d[&amp;#034;Name&amp;#034;]`) and what units the sensor readings are in (`d[&amp;#034;Units&amp;#034;]`). The &amp;#034;NativeProperties&amp;#034; (of which, there are one at present) are properties that can be changed, so the user can also change the &amp;#034;MeasurementPeriod&amp;#034; with `d[&amp;#034;MeasurementPeriod&amp;#034;] = 1`. &#xD;
&#xD;
 Finally, there is a simple interface that allows for real-time charting of the sensor data. Running `goioRTInterface[d]` yields: &#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
##Data collection&#xD;
A major feature of v1.1 is the ability to conduct an experiment and easily store the sensor information. Running an experiment involves two steps. The first is to create an experiment with `tsk = goioExperiment[&amp;lt;spp&amp;gt;,&amp;lt;np&amp;gt;,&amp;#034;Title&amp;#034;-&amp;gt; &amp;lt;title&amp;gt;,&amp;#034;Comment&amp;#034;-&amp;gt; &amp;lt;comment&amp;gt;]`, where *spp* is the seconds per point and *np* is the number of points that will be acquired. Both &amp;#034;Title&amp;#034; and &amp;#034;Comment&amp;#034; are optional, but &amp;#034;Title&amp;#034; should be filled in as it is used in other features of the package. This function returns what is called a `ScheduledTaskObject` which we have to start when the experiment is supposed to begin. Starting a task is done with `StartScheduledTask[tsk]` and a message (a terse &amp;#039;Done&amp;#039;) will be printed when the experiment is over. &#xD;
&#xD;
 Once completed (well, not technically true, since you can run these commands during the experiment), a list of all experiments run during this session can be obtained with `goioDataTable`:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
The experiment number is used as an identifier; for example, to plot the first set of data, one would use `goioPlot[1]`. &#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
 This function uses all of the options of `DateListPlot`, which allows for a fair amount of customization if the end user desires. For further customization or analysis, the sensor data can be extracted as a list with `goioDataList[1]`, which returns a list of {x,y} pairs where the time is now in seconds as opposed to dates. Finally, the user can store the data by saving the packages session symbol with a command `Save[&amp;#034;&amp;lt;filename&amp;gt;&amp;#034;, $GoIOSessionData]`. All of the experiments are stored in that one symbol and can be restored (via `Get`) at a later date. &#xD;
&#xD;
##Conclusion&#xD;
Version 1.1 is reasonably stable and in my opinion provides end users with a functional data acquisition system using Vernier sensors, a Raspberry Pi and *Mathematica*. My intent is to add features and functionality, along with error-checking and documentation, in subsequent v1.x releases. My goal is to have a solid foundation in place so that v2.0 will come with suitable functionality and documentation that can be used to create laboratory experiments in the high school and undergraduate teaching environments.&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=go-link_home.896.279.jpg&amp;amp;userId=11733&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=starting_goio.PNG&amp;amp;userId=61884&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=goiointerface.gif&amp;amp;userId=61884&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=goiotable.PNG&amp;amp;userId=61884&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=goioplot.PNG&amp;amp;userId=61884</description>
    <dc:creator>BoB LeSuer</dc:creator>
    <dc:date>2016-03-27T19:47:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1390630">
    <title>Quantum Chemistry Animations</title>
    <link>https://community.wolfram.com/groups/-/m/t/1390630</link>
    <description>A couple of weeks ago I experimented with automating inputs and visualizing results from the [CP2K][1] quantum chemistry software via Mathematica. My goal was to visualize the formation of a water molecule. I knew just enough about computational chemistry to stumble my way to making an animation that sort of looked like I wanted, although I&amp;#039;m sure it&amp;#039;s horribly inaccurate. Are there any other people in the community who have worked on projects like this?&#xD;
&#xD;
[Video][3]&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
  [1]: https://www.cp2k.org/&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=temp.jpg&amp;amp;userId=64737&#xD;
  [3]: https://www.youtube.com/watch?v=foG5LgFYb2o</description>
    <dc:creator>Michael Hale</dc:creator>
    <dc:date>2018-07-23T22:58:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1874816">
    <title>[Notebook] Genome analysis and the SARS-CoV-2</title>
    <link>https://community.wolfram.com/groups/-/m/t/1874816</link>
    <description>*MODERATOR NOTE: coronavirus resources &amp;amp; updates:* https://wolfr.am/coronavirus&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
I want to show a few ways in which Mathematica can be used to do various types of analysis on gene sequences. The application will of course be to the recent novel coronavirus 2019-nCoV. But the methods are generally applicable.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Fold_Image.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/389949f6-7b32-43d3-a094-1a10edf61ef4</description>
    <dc:creator>Daniel Lichtblau</dc:creator>
    <dc:date>2020-02-07T23:49:44Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/963198">
    <title>Interactively query bond information</title>
    <link>https://community.wolfram.com/groups/-/m/t/963198</link>
    <description>There was a [recent question][1] on the stack exchange was about how to find dihedral angles from an XYZ file, which contains atom types and 3D coordinates for a molecule or group of molecules.  A dihedral angle is the angle between two intersecting planes.  In chemistry, we define the dihedral among four atoms as the angle between the plane containing the first three atoms and the last three atoms.  I got to wishing that I could do it interactively like you can in other chemistry-specific software.&#xD;
&#xD;
&#xD;
This is my attempt at such a tool, code below.  You can query for bond lengths, bond angles, and dihedral angles.  You could look at the angles found in our 3D model of ibuprofen,&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
or compare the bond angles in five-memebered and six-membered rings in buckminsterfullerene,&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
Here is the code to generate these plots.  We use `EventHandler` along with `MousePosition[&amp;#034;Graphics3DBoxIntercepts&amp;#034;]` to correlate mouse-clicks with atom selection, borrowing from [this post](http://mathematica.stackexchange.com/a/28004/9490)&#xD;
&#xD;
    interactiveBondTool[chemical_String]:= Module[{plot, coords, atomLabels, bonds},&#xD;
    	{plot, coords, atomLabels, bonds} = EntityValue[&#xD;
    		Entity[&amp;#034;Chemical&amp;#034;,chemical],&#xD;
    		{&amp;#034;MoleculePlot&amp;#034;, &amp;#034;AtomPositions&amp;#034;, &amp;#034;VertexTypes&amp;#034;, &amp;#034;EdgeRules&amp;#034;}&#xD;
    	];&#xD;
    	If[&#xD;
    		Head /@ {plot, coords, atomLabels, bonds} === {Graphics3D, List, List, List},&#xD;
    		interactiveBondTool[ {plot, coords, atomLabels, bonds} ],&#xD;
    		Missing[&amp;#034;NotAvailable&amp;#034;]&#xD;
    	]&#xD;
    ];&#xD;
    &#xD;
    interactiveBondTool[{plot_, coords_, atomLabels_, bonds_}] := Module[&#xD;
    	{dihedralFromVectors, dihedralFromAtomNumbers, bondLength, bondAngle,&#xD;
    	findAtomNearestToLine, bondInfoBox},&#xD;
    	&#xD;
    	dihedralFromVectors[{b1_, b2_, b3_}] := Module[{n1, n2}, &#xD;
    		(*http://math.stackexchange.com/a/47084/210969*)&#xD;
    		n1 = Normalize@Cross[b1, b2];&#xD;
    		n2 = Normalize@Cross[b2, b3];&#xD;
    		ArcTan[n1.n2, Cross[n1, Normalize@b2].n2]&#xD;
    	];&#xD;
    	&#xD;
    	dihedralFromAtomNumbers[{a1_,a2_,a3_,a4_}]:=dihedralFromVectors[&#xD;
    		(Subtract@@coords[[#]])&amp;amp;/@{{a1,a2},{a2,a3},{a3,a4}}&#xD;
    	];&#xD;
    	&#xD;
    	bondLength[{a1_,a2_}]:=EuclideanDistance@@coords[[{a1,a2}]];&#xD;
    	&#xD;
    	bondAngle[{a1_,a2_,a3_}]:=VectorAngle @@ ((Subtract@@coords[[#]]) &amp;amp;/@ {{a2,a1},{a2,a3}});	&#xD;
    	&#xD;
    	findAtomNearestToLine[{v1_,v2_},pts_]:=Module[{nearestFunc},&#xD;
    		&#xD;
    		(* adapted from this answer: http://mathematica.stackexchange.com/a/28004/9490 *)&#xD;
    		&#xD;
    		nearestFunc=Function[{u},Norm/@({#/10,u-v1-#}&amp;amp;@Projection[u-v1,v2-v1])];&#xD;
    		&#xD;
    		First@Nearest[(nearestFunc/@pts)-&amp;gt;pts,{0,0}]&#xD;
    	];&#xD;
    	&#xD;
    	findAtomNearestToLine[None,pts_]:=Nothing;&#xD;
    	&#xD;
    	bondInfoBox[pts_]:=&#xD;
    		Grid[{&#xD;
    			{&amp;#034;atom (atom number)&amp;#034;,Grid@&#xD;
    			Thread[{atomLabels[[pts]],pts,{Red,Yellow,Green,Blue}[[;;(Length@pts)]]}]},&#xD;
    			{&amp;#034;bond length&amp;#034;, If[Length@Union@pts&amp;gt;1,&#xD;
    			(bondLength@pts[[;;2]])/100,&amp;#034;&amp;#034;]},&#xD;
    			{&amp;#034;bond angle&amp;#034;, If[Length@Union@pts&amp;gt;2,&#xD;
    			(bondAngle@pts[[;;3]])/Degree,&amp;#034;&amp;#034;]},&#xD;
    			{&amp;#034;dihedral angle&amp;#034;, If[Length@Union@pts&amp;gt;3,&#xD;
    			(dihedralFromAtomNumbers@pts[[;;4]])/Degree,&amp;#034;&amp;#034;]}&#xD;
    			},&#xD;
    			Frame-&amp;gt;All&#xD;
    		];&#xD;
    			&#xD;
    	DynamicModule[&#xD;
    		{clicked={},atoms={},spheres={},atomlabels={}},&#xD;
    		&#xD;
    		atoms =Dynamic[Flatten[Position[coords,#]&amp;amp;/@clicked]];&#xD;
    		atomlabels:=With[&#xD;
    			{pos=atoms},&#xD;
    			If[pos==={},&#xD;
    				{},&#xD;
    				atomLabels[[#]]&amp;amp;/@pos&#xD;
    			]&#xD;
    		];&#xD;
    				&#xD;
    		spheres=Dynamic[&#xD;
    			Transpose[{&#xD;
    				{Red,Yellow,Green,Blue}[[;;Length@clicked]],&#xD;
    				Sphere[#,40]&amp;amp;/@clicked }&#xD;
    			]&#xD;
    		];&#xD;
    		EventHandler[&#xD;
    			Row[{&#xD;
    				MouseAppearance[&#xD;
    					Show[&#xD;
    						plot,&#xD;
    						Graphics3D[spheres],&#xD;
    						ImageSize-&amp;gt;500&#xD;
    					],&#xD;
    				&amp;#034;Arrow&amp;#034;],&#xD;
    				&#xD;
    				Dynamic@bondInfoBox[Setting[atoms]]&#xD;
    				&#xD;
    			}],&#xD;
    			{&amp;#034;MouseClicked&amp;#034;:&amp;gt;&#xD;
    				If[&#xD;
    					Length@clicked===4,&#xD;
    					clicked={},&#xD;
    					AppendTo[clicked,&#xD;
    						findAtomNearestToLine[MousePosition[&amp;#034;Graphics3DBoxIntercepts&amp;#034;],coords]&#xD;
    					]&#xD;
    				]&#xD;
    &#xD;
    			},PassEventsDown-&amp;gt;True&#xD;
    		]&#xD;
    	]&#xD;
    ];&#xD;
&#xD;
&#xD;
  [1]: http://mathematica.stackexchange.com/q/130929/9490&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=5686mol1.gif&amp;amp;userId=130877&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=2300mol2.gif&amp;amp;userId=130877</description>
    <dc:creator>Jason Biggs</dc:creator>
    <dc:date>2016-11-14T23:43:52Z</dc:date>
  </item>
</rdf:RDF>

