You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: invariantMultiply_new.m
    path of file: ./repos/IRtools/Extra/prblur_tools/@psfMatrix/private
    
    the code of the file until where you have to start completion: function Y = invariantMultiply_new( A, X)
%
%           Y = invariantMultiply( A, X );
%
%  This function computes the multiplication of a spatially invariant
%  point spread function (PSF) times an image 
%                y = A*x
%
%  Here we use a Kronecker product approach to better handle reflexive
%  boundary conditions
%
%  Input:
%            A  -  psfMatrix object
%            X  -  array containing the image to which the psfMatrix
%                  is to be multiplied.
%
%  Output:
%            Y  -  contains the result after PSF multiplication.
%

%  J. Nagy  7/5/2016


    
function Y = invariantMultiply_new( A, X)
%
%           Y = invariantMultiply( A, X );
%
%  This function computes the multiplication of a spatially invariant
%  point spread function (PSF) times an image 
%                y = A*x
%
%  Here we use a Kronecker product approach to better handle reflexive
%  boundary conditions
%
%  Input:
%            A  -  psfMatrix object
%            X  -  array containing the image to which the psfMatrix
%                  is to be multiplied.
%
%  Output:
%            Y  -  contains the result after PSF multiplication.
%

%  J. Nagy  7/5/2016

imsize = size( X );
psfMatData = A.matdata;

switch A.boundary
    case 'periodic'
        if A.transpose
            Y = real(ifft2(conj(psfMatData).*fft2(X)));
        else
            Y = real(ifft2(psfMatData.*fft2(X)));
        end