Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing vector potential through external_vector_potential isn't working #5

Open
Shiva-Konakanchi opened this issue Jul 16, 2021 · 2 comments

Comments

@Shiva-Konakanchi
Copy link

import numpy as np
from svirl import GLSolver
import seaborn as sns
import matplotlib.pyplot as plt

gl = GLSolver(
    dx = 0.5, dy = 0.5,
    Lx = 64, Ly = 64,
    order_parameter = 'random',
    random_seed = 4,
    homogeneous_external_field = 0.05,
    external_field = 0.00,
    gl_parameter = 5.0,  # np.inf
    normal_conductivity = 200.0,
    dtype = np.float64,
)

aax = gl.vars.vector_potential[0]       # store the vector potential for uniform field for future use
aay = gl.vars.vector_potential[1]

gl.solve.td(dt=0.01, Nt=10000)            # Now do the time evolution
gl.solve.cg(n_iter = 1000)

heat = sns.heatmap(gl.observables.superfluid_density, cmap="CMRmap_r", vmin=0, vmax=1)
heat.invert_yaxis()
plt.savefig('1.png')

Produces this output:
1

However, passing A produces different output as shown below:

ginz = GLSolver(                            
    dx = 0.5, dy = 0.5,
    Lx = 64, Ly = 64,
    order_parameter = 'random',
    random_seed = 4,
    homogeneous_external_field = 0.00,
    external_field = 0.00,
    gl_parameter = 5.0,  # np.inf
    normal_conductivity = 200.0,
    dtype = np.float64,
)

ginz.params.external_vector_potential = (aax, aay) # aax and aay are obtained from the piece of code above

ginz.solve.td(dt=0.01, Nt=10000)            # Do the same time evolution as before
ginz.solve.cg(n_iter = 1000)

heat = sns.heatmap(ginz.observables.superfluid_density, cmap="CMRmap_r", vmin=0, vmax=1)
heat.invert_yaxis()
plt.savefig('2.png')

2

@shriram-jagan
Copy link

Shiva, I can reproduce this issue. I think internally we are setting 'vpei' in params.py based on the supplied vector potential, but I'm guessing we are not taking it into account when we invoke the kernels.

@Shiva-Konakanchi
Copy link
Author

Hi Shriram, thanks for taking a look. I agree, somehow '_vpei' isn't being used in the evolution kernels. Also, another hint in this direction is that if I use 'external_field' to specify the value of the external field in the GLSolver object instead of 'uniform_external_field', that value isn't being used in calculations either. Note that the documentation says that for now 'external_field' only accepts a number (although it is designed for other things in the future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants