New ansatzes
This commit is contained in:
parent
9c8f4c036c
commit
78f435df89
@ -195,5 +195,100 @@ colorbar;
|
|||||||
title('Gaussian + Honeycomb lattice');
|
title('Gaussian + Honeycomb lattice');
|
||||||
xlabel('x'); ylabel('y');
|
xlabel('x'); ylabel('y');
|
||||||
|
|
||||||
|
%%
|
||||||
|
% Parameters
|
||||||
|
A = 1; % Modulation amplitude
|
||||||
|
p = 2 * pi / 10; % Magnitude of p_j (adjust wavelength)
|
||||||
|
L = 50; % Spatial extent
|
||||||
|
N = 500; % Grid resolution
|
||||||
|
|
||||||
|
% Coordinate grid
|
||||||
|
x = linspace(-L, L, N);
|
||||||
|
y = linspace(-L, L, N);
|
||||||
|
[X, Y] = meshgrid(x, y);
|
||||||
|
|
||||||
|
% Define p_j vectors at 0°, 120°, and 240°
|
||||||
|
angles = [0, 2*pi/3, 4*pi/3];
|
||||||
|
P = zeros(size(X));
|
||||||
|
|
||||||
|
for j = 1:3
|
||||||
|
pj = p * [cos(angles(j)); sin(angles(j))]; % 2D vector
|
||||||
|
dotprod = pj(1) * X + pj(2) * Y;
|
||||||
|
P = P + cos(dotprod);
|
||||||
|
end
|
||||||
|
|
||||||
|
P = A * P; % Apply modulation amplitude
|
||||||
|
|
||||||
|
% Plot
|
||||||
|
figure(20);
|
||||||
|
imagesc(x, y, P);
|
||||||
|
axis equal tight;
|
||||||
|
colormap turbo; colorbar;
|
||||||
|
xlabel('$x$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
ylabel('$y$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
title('Triangle Phase: $P(\mathbf{r}_\perp) = A \sum_{j=1}^3 \cos(\mathbf{p}_j \cdot \mathbf{r}_\perp)$', ...
|
||||||
|
'Interpreter', 'latex', 'FontSize', 16);
|
||||||
|
|
||||||
|
% Parameters
|
||||||
|
A = -1; % Modulation amplitude
|
||||||
|
p = 2 * pi / 10; % Magnitude of p_j (adjust wavelength)
|
||||||
|
L = 50; % Spatial extent
|
||||||
|
N = 500; % Grid resolution
|
||||||
|
|
||||||
|
% Coordinate grid
|
||||||
|
x = linspace(-L, L, N);
|
||||||
|
y = linspace(-L, L, N);
|
||||||
|
[X, Y] = meshgrid(x, y);
|
||||||
|
r = cat(3, X, Y);
|
||||||
|
|
||||||
|
% Define p_j vectors at 0°, 120°, and 240°
|
||||||
|
angles = [0, 2*pi/3, 4*pi/3];
|
||||||
|
P = zeros(size(X));
|
||||||
|
|
||||||
|
for j = 1:3
|
||||||
|
pj = p * [cos(angles(j)); sin(angles(j))]; % 2D vector
|
||||||
|
dotprod = pj(1) * X + pj(2) * Y;
|
||||||
|
P = P + cos(dotprod);
|
||||||
|
end
|
||||||
|
|
||||||
|
P = A * P; % Apply modulation amplitude
|
||||||
|
|
||||||
|
% Plot
|
||||||
|
figure(21);
|
||||||
|
imagesc(x, y, P);
|
||||||
|
axis equal tight;
|
||||||
|
colormap turbo; colorbar;
|
||||||
|
xlabel('$x$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
ylabel('$y$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
title('Honeycomb Phase: $P(\mathbf{r}_\perp) = A \sum_{j=1}^3 \cos(\mathbf{p}_j \cdot \mathbf{r}_\perp)$', ...
|
||||||
|
'Interpreter', 'latex', 'FontSize', 16);
|
||||||
|
|
||||||
|
% Parameters
|
||||||
|
A = 1;
|
||||||
|
p = 2 * pi / 10; % Wavevector magnitude
|
||||||
|
theta = pi/2; % Angle of the wavevector (45° for diagonals)
|
||||||
|
L = 50;
|
||||||
|
N = 500;
|
||||||
|
|
||||||
|
% Grid
|
||||||
|
x = linspace(-L, L, N);
|
||||||
|
y = linspace(-L, L, N);
|
||||||
|
[X, Y] = meshgrid(x, y);
|
||||||
|
|
||||||
|
% Define wavevector p
|
||||||
|
p_vec = p * [cos(theta); sin(theta)];
|
||||||
|
|
||||||
|
% Compute density
|
||||||
|
P = A * cos(p_vec(1) * X + p_vec(2) * Y);
|
||||||
|
|
||||||
|
% Plot
|
||||||
|
figure(22);
|
||||||
|
imagesc(x, y, P);
|
||||||
|
axis equal tight;
|
||||||
|
colormap turbo; colorbar;
|
||||||
|
xlabel('$x$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
ylabel('$y$', 'Interpreter', 'latex', 'FontSize', 14);
|
||||||
|
title('Stripe Phase: $P(\mathbf{r}_\perp) = A \cos(\mathbf{p} \cdot \mathbf{r}_\perp)$', ...
|
||||||
|
'Interpreter', 'latex', 'FontSize', 16);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user