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

Making a 1-way spin wave packet #309

Open
dovod91 opened this issue Jan 13, 2025 · 0 comments
Open

Making a 1-way spin wave packet #309

dovod91 opened this issue Jan 13, 2025 · 0 comments

Comments

@dovod91
Copy link

dovod91 commented Jan 13, 2025

Dear Team,

Thank you again for the software and your support.

I am struggling to code a 1-way spin wave packet for my simulations.
The pulse should be in the form:

sin(w t - k x) = sin(k x) sin(w t) + cos(k x) cos(w t) [1]

Therefore, it is my understanding that I should end up adding an energy term in the system in the form of:

system.energy += mm.Zeeman(H=H, func=func, dt=dt_)

where H is my 'spatial' field profile, and 'func' can be my time-dependent field, together making the final expression for the field.
So far, and by checking with the API, my current code looks like this:

# Field in space:
def field_1_sin_spat(point):
    x, y, z = point

    k_0 = 0.175*2*3.14*1e6 # 0.175 rad/um
    sr2_x = 5*10e-9
    
    c_k = 0.1*k_0
    a_1 = 1/(2*(c_k)**2)
    t_0 = 1e-10

    Amp = 80e0
    gauss_x = np.exp( -((x+sr2_x)**2) / (4*a_1) )

    field_1 = (Amp*np.sin(k_0 * x)*gauss_x, 0, 0)

    return (Amp*np.sin(k_0 * x)*gauss_x, 0, 0)

# Field in space:
def field_2_cos_spat(point):
    x, y, z = point

    k_0 = 0.175*2*3.14*1e6 # 0.175 rad/um
    sr2_x = 5*10e-9
    
    c_k = 0.1*k_0
    a_1 = 1/(2*(c_k)**2)
    t_0 = 1e-10

    Amp = 80e0
    gauss_x = np.exp( -((x+sr2_x)**2) / (4*a_1) )

    field_2 = (Amp*np.cos(k_0 * x)*gauss_x, 0, 0)

    return (Amp*np.cos(k_0 * x)*gauss_x, 0, 0)

H_1_sin = df.Field(mesh, nvdim=3, value=field_1_sin_spat)
H_2_cos = df.Field(mesh, nvdim=3, value=field_2_cos_spat)

The time-dependent fields:

def field_1_sin_time(t):
    
    omega = 2*3.14*1e9 # 1 GHz
    
    c_w = 0.4*omega
    b_1 = 1/(2*(c_w)**2)
    t_0 = 2e-9

    return np.sin(omega*t)*np.exp(-((t-t_0)**2) / (4*b_1))


def field_2_cos_time(t):
   
    omega = 2*3.14*1e9 # 1 GHz
    
    c_w = 0.4*omega
    b_1 = 1/(2*(c_w)**2)
    t_0 = 2e-9

    return np.cos(omega*t)*np.exp(-((t-t_0)**2) / (4*b_1))

So the system should be:

system.energy += mm.Zeeman(H=H, func=field_1_sin_time, name='field1', dt=dt_)    # first term of [1]
system.energy += mm.Zeeman(H=H, func=field_2_cos_time, name='field2', dt=dt_)    # second term of [1]

I am not obtaining what expected: While for a certain point, the coded wave packet shows only two maxima, in the simulation there are more travelling maxima through that point:
image

image

Maybe there is an easier way to code this 1-way pulse in ubermag? Thank you so much for your suggestions.

Best regards,

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

1 participant