MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

digit-precision for gaussian inputs converting cartesian matrix from

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128855] digit-precision for gaussian inputs converting cartesian matrix from
  • From: "locometro, INMETRO/UFRJ, Brasil - RJ" <decicco10 at gmail.com>
  • Date: Fri, 30 Nov 2012 05:59:05 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi Folks,

I have some issues to discuss here:
 
My goal:  rotation,x-y plane, apllying over some cartesians vectors.


(*step 1: 
I import a input.txt for Gaussian program like this:  *)

%chk=campoX_1.chk
%mem=2gb
%nproc=4
#p b3lyp/6-31+g(d,p) geom=connectivity field=x+1 pop=reg int=ultrafine

single point campo direcao X+01

0 1
 C                  0.00000000    0.00000000    0.00000000
 C                  1.41786969    0.00000000    0.00000000
 C                 -0.68401407    1.24221249    0.00000000
etc...(72lines).


(*step 2: I extract the  data from input above, as below:*)

               data2 = Take[data1, {9, 56}, {2, 4}]]
               data3 = Flatten[Take[data1, {9, 56}, {1}]];
               data4 = Drop[data1, {8, 56}, None];

  (*As I need the 1st(molecules symbol), 2nd (X) , 3rd (Y) and 4th(Z) columns, for my table and calculations*).

(*step 3:  Rotation 45 degree, over plane x-y, using the exctracted columns*)

               rotZ = RotationMatrix[45 Degree, {0, 0, 1}];
               datarotZ = (rotZ.#) & /@ data2 (*this promote the rotation matrice over  x-y-x*)

 output-> {{0., 0., 0.}, {1.00259, 1.00259, 0.}, {-1.36205, 0.394706, 
  0.}, {-2.49436, 0.668808, 0.00086376}, {1.85795, 
  1.79358, -0.00004936}, {-3.36958, -5.96549, -0.00908542}, \
{-2.95205, -7.30672, 0.00803008},...etc (* cartesians numbers already rotated 45 degrees*).

BUT NOTICE that the numbers of digits has been modified!, I need the original 8 digits, including zeros, after the decimal point! I do not want mathematica aplying any aproximation or cuts.

(*step 4: then I reduce the data back to a table form:*)

            datafinal = Partition[Flatten[Transpose[{data3, datarotZ}], 2], 4] ;
            FlattenAt[Insert[data4, datafinal, 9], 9]
(*I use this because, in the middle of the output list appears doubles "{{" "}}", any suggestion?*);

(*step5: final table:*) ( just want to put things as the same original input    table which data were extracted*)

                 tabelafinal = 
                   Grid[datafinal, ItemSize -> {{1, 18, 7, 7}, 1}, Alignment -> "."]

output -> {
 {"C", 0., 0., 0.},
 {"C", 1.00259, 1.00259, 0.},
 {"C", -1.36205, 0.394706, 0.},
 {"N", -2.49436, 0.668808, 0.00086376},
 {"N", 1.85795, 1.79358, -0.00004936},
 {"C", -3.36958, -5.96549, -0.00908542}
}


And finally when I export tabela final:

           Export["RotZinput.txt", %, "table"]

   (* the final table  in txt file  is not so well formatted. See what happens to "0.", it takes  the decimals zeros, why?

and some numbers do not have the same digits.  I just need 8 digits after "." and columns aligned to ".", as the original input.*)


%chk=campoX_1.chk
%mem=2gb
%nproc=4
#p	b3lyp/6-31+g(d,p)	geom=connectivity	field=x+1	pop=reg	int=ultrafine

	single	point	campo	direcao	X+01


C	0.	0.	0.
C	1.002585272637868	1.002585272637868	0.
C	-1.362047862677636	0.39470588802961654	0.
N	-2.4943601616156514	0.6688078909474289	0.00086376
N	1.8579481345030466	1.7935803739172627	-0.00004936
C	-3.369578072779666	-5.965493596202908	-0.00908542....etc.



  • Prev by Date: Re: Rules on integer elemens of the list
  • Next by Date: Re: ImageResize does not linearize before resize?
  • Previous by thread: Mathematica 9--Is This A Joke?
  • Next by thread: Re: ImageResize does not linearize before resize?