Git Product home page Git Product logo

microsoft / svirl Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 10.0 2.03 MB

Svirl is GPU-accelerated solver of complex Ginzburg-Landau equations for superconductivity. It consists of time-dependent solver to describe vortex dynamics and free energy minimizer to accurately find static configurations.

License: MIT License

Python 68.24% C 30.90% C++ 0.73% Shell 0.13%
ginzburg-landau superconductivity cuda scientific-computing vortex python gpu

svirl's Introduction

Svirl: GPU-accelerated Ginzburg-Landau equations solver

Svirl is an open source solver of complex Ginzburg-Landau (GL) equations mainly used to describe magnetic vortices in superconductors. It consists of two parts: (i) time-dependent Ginzburg-Landau (TDGL) solver [1] and (ii) GL free energy minimizer with uses modified non-linear conjugate gradient method.

The current version of Svirl can be used for two-dimensional (2D) systems only, the work on three-dimensional (3D) solver is in progress.

Svirl has intuitive Python3 API and requires nVidia GPU to run. The idea of GPU-acceletrated TDGL solver was initially developed in the framework of OSCon project for infinite GL parameter limit.

Main features

  • 2D time-dependent GL solver
  • 2D GL free energy minimizer
  • finite and infinite GL parameters
  • user-defined material domain for order parameter
  • calculates observables such as GL free energy, current density, and magnetic field
  • detector of vortex positions
  • uses nVidia CUDA by means of pyCUDA

Example

import numpy as np
from svirl import GLSolver

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

gl.solve.td(dt=0.1, Nt=1000)

gl.solve.cg(n_iter = 1000)

vx, vy, vv = gl.params.fixed_vortices.vortices
print('Order parameter: array of shape', gl.vars.order_parameter.shape)
print('%d vortices detected' % vx.size)

print('Free energy: ', gl.observables.free_energy)

ch, cv = gl.observables.current_density
print('Total current density: two arrays of shape', ch.shape, '[horizontal links] and', cv.shape, '[vertical links]')

ch, cv = gl.observables.supercurrent_density
print('Supercurrent density: two arrays of shape', ch.shape, '[horizontal links] and', cv.shape, '[vertical links]')
print('Magnetic field: array of shape', gl.observables.magnetic_field.shape)

References

  1. I.A. Sadovskyy et al, Stable large-scale solver for Ginzburg-Landau equations for superconductors, J. Comp. Phys. 294, 639 (2015); arXiv:1409.8340.

Code of conduct

We follow the Microsoft Open Source Code of Conduct.

svirl's People

Contributors

ivan-sadovsky avatar microsoft-github-operations[bot] avatar microsoftopensource avatar shriramjagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

svirl's Issues

Units of normal_conductivity?

Hi guys, what units is the normal_conductivity that we pass to GLSolver in? CGS units or dimensionless units? If it is in dimensionless units, what is it normalized by (couldn't find units of $\sigma$ in the paper)? Please let me know. Thanks!

ACTION REQUIRED: Microsoft needs this private repository to complete compliance info

There are open compliance tasks that need to be reviewed for your svirl repo.

Action required: 4 compliance tasks

To bring this repository to the standard required for 2021, we require administrators of this and all Microsoft GitHub repositories to complete a small set of tasks within the next 60 days. This is critical work to ensure the compliance and security of your microsoft GitHub organization.

Please take a few minutes to complete the tasks at: https://repos.opensource.microsoft.com/orgs/microsoft/repos/svirl/compliance

  • The GitHub AE (GitHub inside Microsoft) migration survey has not been completed for this private repository
  • No Service Tree mapping has been set for this repo. If this team does not use Service Tree, they can also opt-out of providing Service Tree data in the Compliance tab.
  • No repository maintainers are set. The Open Source Maintainers are the decision-makers and actionable owners of the repository, irrespective of administrator permission grants on GitHub.
  • Classification of the repository as production/non-production is missing in the Compliance tab.

You can close this work item once you have completed the compliance tasks, or it will automatically close within a day of taking action.

If you no longer need this repository, it might be quickest to delete the repo, too.

GitHub inside Microsoft program information

More information about GitHub inside Microsoft and the new GitHub AE product can be found at https://aka.ms/gim or by contacting [email protected]

FYI: current admins at Microsoft include @shriramjagan, @ivan-sadovsky

3D geometries

Hi all,

I would like to do Ginzburg-Landau simulations on 3 dimensional geometries, as shown for instance in the reference paper. Is there any update on when 3D simulations could be implemented in Svirl?

Thanks!

Kind regards,
Axel

Passing vector potential through external_vector_potential isn't working

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

SourceModule with -std=c++11 option

Line self._cuda_module = cuda_compiler.SourceModule(cuda_code, options=['-std=c++11']) in svirl/parallel/startup.py sometimes generates a warning
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.