Giter VIP home page Giter VIP logo

Comments (1)

loganbvh avatar loganbvh commented on August 23, 2024

Hi, good question!

You can define a function that sets the critical temperature T_c of the device as a function of both position and time (this is the disorder_epsilon parameter in tdgl.solve()). To trap some flux in a hole in a device, you can set T_c = 0 for a region of the device connecting the hole to the exterior, thereby creating a normal metal channel that will allow vortex entry. Below is a script that implements this protocol to trap a single flux quantum in a superconducting ring. Hopefully this is enough to get you started.

import numpy as np
import tdgl
from tdgl.geometry import circle

# Define the device
film_radius = 1
hole_radius = film_radius / 3
layer = tdgl.Layer(london_lambda=0.1, coherence_length=0.05, thickness=0.01)
film = tdgl.Polygon("film", points=circle(film_radius)).resample(201)
hole = tdgl.Polygon("hole", points=circle(hole_radius)).resample(201)
device = tdgl.Device(
    "ring",
    layer=layer,
    film=film,
    holes=[hole],
    length_units="um",
)

# Make the mesh
device.make_mesh(max_edge_length=0.025)

# Setup the field cooling protocol:
# 1. Use disorder_epsilon to create a temporary normal metal channel connecting the
#    film exterior and the hole.
# 2. Apply a uniform magnetic field sufficient to trap a single flux quantum in the hole.
# 3. Remove the normal metal channel, then turn off the magnetic field.

options = tdgl.SolverOptions(
    output_file="ring.h5",
    solve_time=250,
    field_units="mT",
    current_units="uA",
    dt_max=0.01,
)

def epsilon(r, *, t):
    """Sets T_c = 0 for a portion of the film until time t = 100."""
    x, y = r  # r = (x, y) is the position within the film
    # t is time in units of \tau_0
    if t < 100 and y > 0 and np.abs(x) < 0.1:
        return -1
    return 1


def scale_func(x, y, z, *, t):
    """A scale factor that turns off the applied field after time t = 200."""
    if t < 200:
        return 1
    return 0

# Apply a uniform magnetic field equal to 1.5 * Phi_0 / film_area
# to trap one Phi_0 in the hole
film_area = np.pi * (film_radius * tdgl.ureg("um"))**2
applied_field = 1.5 * (tdgl.ureg("Phi_0") / film_area).to("mT")
print(f"Applied field = {applied_field}")

# Combine the scale factor and uniform magnetic field
# to define the applied magnetic vector potential.
applied_vector_potential = (
    # Time-dependent scale factor
    tdgl.sources.Scale(scale_func)
    # Uniform applied magnetic field
    * tdgl.sources.ConstantField(
        applied_field.to(options.field_units).magnitude,
        length_units=device.length_units,
        field_units=options.field_units,
    )
)

# Solve the model
solution = tdgl.solve(
    device,
    options,
    applied_vector_potential=applied_vector_potential,
    disorder_epsilon=epsilon,
)

Here is a video created by running the following from the command line:

python -m tdgl.visualize --input="ring.h5" --output="ring.mp4" animate --fps=15 --quantities order_parameter phase supercurrent epsilon
ring.mp4

from py-tdgl.

Related Issues (20)

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.