function [psi] = setupCosineModulatedAnsatz(this, Params, Transf) format long % Extract transformation coordinates X = Transf.X; Y = Transf.Y; % Check the BiasAnsatz and apply the corresponding function if strcmp(this.Ansatz, 'stripe') % STRIPES 2-D % Parameters c = 1; % Fourier coefficient k = 2 * pi / Params.Lx; % Wavenumber n = 2; % Order % Define the 2D function for stripes psi = (1 + (c * cos(n * k * Y))) / (1 + (0.5 * c^2)); elseif strcmp(this.Ansatz, 'triangular') % TRIANGULAR LATTICE 2-D % Parameters c1 = 0.2; c2 = 0.2; k = 2 * pi / Params.Lx; % Wavenumber n = 1; % Define the 2D function for a triangular lattice psi = 1 + (c1 * cos(n * k * (2/sqrt(3)) * Y)) + ... (2 * c2 * cos(n * k * (1/sqrt(3)) * Y) .* cos(n * k * X)); elseif strcmp(this.Ansatz, 'honeycomb') % HONEYCOMB LATTICE 2-D % Parameters c1 = 0.2; c2 = 0.2; k = 2 * pi / Params.Lx; % Wavenumber n = 1; % Define the 2D function for a honeycomb lattice psi = 1 - (c1 * cos(n * k * (2/sqrt(3)) * X)) - ... (2 * c2 * cos(n * k * (1/sqrt(3)) * X) .* cos(n * k * Y)); else error('Unknown Ansatz type'); end % Normalize the result Norm = sum(abs(psi(:)).^2) * Transf.dx * Transf.dy; psi = sqrt(Params.N) * psi / sqrt(Norm); end