Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

about PSI purity #16

jesusmontera started this conversation in General
about PSI purity #16
Sep 8, 2022 * 0 comments
Return to top
Discussion options

jesusmontera
Sep 8, 2022

Hello again, when running the example "1D_interactive_fermions" without potential (setting V=0 for both oscillator and coulomb), if I get the PSI purity it always return 0.5 (maximun entangled), when it must be 1, because if there is no potential particles can't be entagled. No matter the method I use, Crack or Split. If I initilize the psi with my own function(without potential and with kinetic move), it shows purity 1 like it must be. So what's going on?

def MyPsi2P(size, e1, e2, packetwidth, dt, barrierenergy, barrierwidth, initpos):
psi = np.zeros((size,size),dtype=complex)
centerX = math.floor(size*initpos)
centerY = size - centerX
k1 = math.sqrt(2*e1)
k2 = - math.sqrt(2*e2)
pw = pow(packetwidth,2)
for y in range (size):
for x in range (size):
x0=x-centerX
y0=y-centerY
envelope=math.exp(-(x0*x0+y0*y0) /pw)

phasemoveReal=math.cos(k1*x0)*math.cos(k2*y0) - math.sin(k1*x0)*math.sin(k2*y0)
phasemoveImag=math.cos(k1*x0)*math.sin(k2*y0) + math.sin(k1*x0)*math.cos(k2*y0);
psi[y][x] = complex(envelope * phasemoveReal, envelope * phasemoveImag)
`
And her is the function that measures purity, (with psi reshaped to 1D):
```
def shcroduingerpurity(psi):

size=int(len(psi)**0.5)
p=0
#xMaxm1 = size - 1
for xp in range(0,size,1):
for x in range(xp,size,1):
rhore = 0.0
rhoim = 0.0
for y in range(0,size,1):
i1 = x + size*y;
i2 = xp + size*y;
rhore =rhore + psi[i1].real * psi[i2].real + psi[i1].imag * psi[i2].imag
rhoim = rhoim + psi[i1].real * psi[i2].imag - psi[i2].real*psi[i1].imag
if x == xp:
p = p + rhore*rhore + rhoim*rhoim
else:
p = p + 2.*(rhore*rhore + rhoim*rhoim)


return p
```
```
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
General
Labels
None yet
1 participant