%% STRIPES % 2-D % Parameters c = 1; % Fourier coeffecient k = 2; % wavenumber n = 2; % order % Range for x and y x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); % Create a meshgrid for 2D [~, Y] = meshgrid(x, y); % Define the 2D function f_xy = (1 + (c * cos(n * k * Y))) / (1 + (0.5 * c^2)); % Plot the 2D image using imagesc figure(1); imagesc(x, y, f_xy); axis xy; % Make sure the y-axis is oriented correctly colorbar; xlabel('$x l_o$', 'Interpreter', 'latex', 'FontSize', 14) ylabel('$y l_o$', 'Interpreter', 'latex', 'FontSize', 14) title('Stripe Lattice ansatz for $|\Psi(x,y)|^2$', 'Interpreter', 'latex', 'FontSize', 16); xlabel('x'); ylabel('y'); colormap parula; %% TRIANGULAR LATTICE % 2-D % Parameters c1 = 0.2; c2 = 0.2; k = 3; n = 1; % Range for x and y x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); % Create a meshgrid for 2D [X, Y] = meshgrid(x, y); % Define the 2D function for a triangular lattice f_xy = 1 + (c1 * cos(n * k * (2/sqrt(3)) * Y)) + (2 * c2 * cos(n * k * (1/sqrt(3)) * Y) .* cos(n * k * X)); % Plot the 2D image using imagesc figure(2); clf imagesc(x, y, f_xy); axis xy; % Make sure the y-axis is oriented correctly colorbar; xlabel('$x l_o$', 'Interpreter', 'latex', 'FontSize', 14) ylabel('$y l_o$', 'Interpreter', 'latex', 'FontSize', 14) title('Triangular Lattice ansatz for $|\Psi(x,y)|^2$', 'Interpreter', 'latex', 'FontSize', 16); xlabel('x'); ylabel('y'); colormap parula; %% HONEYCOMB LATTICE % 2-D % Parameters c1 = 0.2; c2 = 0.2; k = 3; n = 1; % Range for x and y x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); % Create a meshgrid for 2D [X, Y] = meshgrid(x, y); % Define the 2D function for a honeycomb lattice f_xy = 1 - (c1 * cos(n * k * (2/sqrt(3)) * X)) - (2 * c2 * cos(n * k * (1/sqrt(3)) * X) .* cos(n * k * Y)); % Plot the 2D image using imagesc figure(3); clf imagesc(x, y, f_xy); axis xy; % Make sure the y-axis is oriented correctly colorbar; xlabel('$x l_o$', 'Interpreter', 'latex', 'FontSize', 14) ylabel('$y l_o$', 'Interpreter', 'latex', 'FontSize', 14) title('Honeycomb Lattice ansatz for $|\Psi(x,y)|^2$', 'Interpreter', 'latex', 'FontSize', 16); xlabel('x'); ylabel('y'); colormap parula; %% GAUSSIAN + STRIPES c = 1; % Fourier coefficient k = 5 * pi; % Use π to get just a couple of modulations across domain n = 5; sigma_y = 0.5; % Narrow along Y to limit rows sigma_x = 0.3; % Wider along X % Grid x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); [X, Y] = meshgrid(x, y); % Gaussian envelope — anisotropic (narrow in y) G = exp(-((X.^2)/(2*sigma_x^2) + (Y.^2)/(2*sigma_y^2))); % Modulation function modulation = (1 + (c * cos(n * k * Y))) / (1 + 0.5 * c^2); % Combine f_modulated = G .* modulation; % Plot figure(4); imagesc(x, y, f_modulated); axis xy; axis equal tight; colormap('hot'); colorbar; title('Gaussian + Stripe Modulation'); xlabel('x'); ylabel('y'); %% GAUSSIAN + TRIANGULAR LATTICE % Parameters c1 = 0.2; c2 = 0.2; k = 5 * pi; % Use π to get just a couple of modulations across domain n = 5; sigma_y = 0.5; % Narrow along Y to limit rows sigma_x = 0.3; % Wider along X % Grid x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); [X, Y] = meshgrid(x, y); % Gaussian envelope — anisotropic (narrow in y) G = exp(-((X.^2)/(2*sigma_x^2) + (Y.^2)/(2*sigma_y^2))); % Triangular lattice modulation modulation = 1 + ... (c1 * cos(n * k * (2/sqrt(3)) * Y)) + ... (2 * c2 * cos(n * k * (1/sqrt(3)) * Y) .* cos(n * k * X)); % Normalize modulation = modulation / (1 + c1 + 2*c2); % Combine with Gaussian f_modulated = G .* modulation; % Plot figure(5); imagesc(x, y, f_modulated); axis xy; axis equal tight; colormap('hot'); colorbar; title('Gaussian + Triangular lattice'); xlabel('x'); ylabel('y'); %% GAUSSIAN + HONEYCOMB LATTICE % Parameters c1 = 0.2; c2 = 0.2; k = 5 * pi; % Use π to get just a couple of modulations across domain n = 5; sigma_y = 0.5; % Narrow along Y to limit rows sigma_x = 0.3; % Wider along X % Grid x = linspace(-2, 2, 500); y = linspace(-2, 2, 500); [X, Y] = meshgrid(x, y); % Anisotropic Gaussian envelope G = exp(-((X.^2)/(2*sigma_x^2) + (Y.^2)/(2*sigma_y^2))); % Honeycomb lattice modulation modulation = 1 - ... (c1 * cos(n * k * (2/sqrt(3)) * X)) - ... (2 * c2 * cos(n * k * (1/sqrt(3)) * X) .* cos(n * k * Y)); % Normalize (optional) modulation = modulation / (1 + c1 + 2*c2); % Combine with Gaussian f_modulated = G .* modulation; % Plot figure(6); imagesc(x, y, f_modulated); axis xy; axis equal tight; colormap('hot'); colorbar; title('Gaussian + Honeycomb lattice'); xlabel('x'); ylabel('y');