From 78f435df893f37df95ddc3a50c2e492a3064aae6 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Fri, 9 May 2025 00:33:03 +0200 Subject: [PATCH] New ansatzes --- Estimations/VisualizeCosineModulatedAnsatz.m | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/Estimations/VisualizeCosineModulatedAnsatz.m b/Estimations/VisualizeCosineModulatedAnsatz.m index f58badb..918591d 100644 --- a/Estimations/VisualizeCosineModulatedAnsatz.m +++ b/Estimations/VisualizeCosineModulatedAnsatz.m @@ -195,5 +195,100 @@ colorbar; title('Gaussian + Honeycomb lattice'); 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);