Author Topic: HS.py  (Read 2590 times)

0 Members and 1 Guest are viewing this topic.

Offline ams_nanolab

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 389
  • Country: in
  • Reputation: 11
    • View Profile
HS.py
« on: November 8, 2012, 10:28 »
Dear Sir,

I am using the HS.py to obtain the system Hamiltonian as posted in http://quantumwise.com/forum/index.php?topic=1548.0#.UJt5gWffX1U

however the output i am getting is like

[[ -4.19645437e-02 -4.49943902e-18j  -2.38524478e-18 -7.39248005e-19j

    0.00000000e+00 +0.00000000e+00j  -2.42319186e-17 -6.11138787e-05j

    7.58941521e-19 +1.33195931e-18j   0.00000000e+00 +0.00000000e+00j

   -7.34151089e-02 -1.35525272e-19j   0.00000000e+00 +0.00000000e+00j

    4.78823195e-05 +9.48676901e-18j  -6.28841737e-05 +6.80929786e-17j

   -1.65869175e-01 -2.45004280e-17j  -3.27102739e-05 +4.53001691e-17j

   -4.74211396e-18 -1.65927479e-01j  -6.28841737e-05 +2.38863291e-18j

   -1.65869175e-01 -9.10475715e-18j   3.27102739e-05 -2.57286258e-18j

   -6.04315656e-18 -1.65927479e-01j]

...]

the fact that there's a space between the real and complex numbers

"a +ib"

instead of

"a+ib"

is making it difficult to read for other programs, could you kindly modify the HS.py script accordingly so it writes in a better format?


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: HS.py
« Reply #1 on: November 8, 2012, 12:13 »
The output is generated by a simple "print" statement, so it would probably be easier to make a post-processing of the output instead than modify the print statement. Seems to me there are 2 spaces between the numbers and one space within them. So, you could just open the output in a text editor, replace two spaces with some unique character like "&", then remove all spaces, then replace back "&" to a space.