Home > manopt > tools > multihconj.m

# multihconj

## PURPOSE

Hermitian-conjugate transpose the matrix slices of an N-D array

## SYNOPSIS

function B = multihconj(A, unused) %#ok

## DESCRIPTION

``` Hermitian-conjugate transpose the matrix slices of an N-D array

function B = multihconj(A)

If A is a 3-D array, then B is a 3-D array such that

B(:, :, i) = A(:, :, i)'

for each i. If A is an N-D array, then B is an N-D array with the slices
A(:, :, i, j, k, ...) Hermitian-conjugate transposed.

This function is just a wrapper for pagectranspose, with a fallback call
to multihconj_legacy in case pagectranspose is not available.
If pagectranspose is available, it is better to call it directly.
Note that pagemtimes also allows to compute products with (c)transposes
without explicitly (c)transposing arrays.

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:
• grassmanncomplexfactory Returns a manifold struct to optimize over the set of subspaces in C^n.
• unitaryfactory Returns a manifold structure to optimize over unitary matrices.
• stiefelcomplexfactory Returns a manifold struct. to optimize over complex orthonormal matrices.
• multiherm Returns the Hermitian parts of the matrices in a 3D array
• multiskewh Returns the skew-Hermitian parts of the matrices in the 3D matrix X.

## SOURCE CODE

```0001 function B = multihconj(A, unused) %#ok<INUSD>
0002 % Hermitian-conjugate transpose the matrix slices of an N-D array
0003 %
0004 % function B = multihconj(A)
0005 %
0006 % If A is a 3-D array, then B is a 3-D array such that
0007 %
0008 %     B(:, :, i) = A(:, :, i)'
0009 %
0010 % for each i. If A is an N-D array, then B is an N-D array with the slices
0011 % A(:, :, i, j, k, ...) Hermitian-conjugate transposed.
0012 %
0013 % This function is just a wrapper for pagectranspose, with a fallback call
0014 % to multihconj_legacy in case pagectranspose is not available.
0015 % If pagectranspose is available, it is better to call it directly.
0016 % Note that pagemtimes also allows to compute products with (c)transposes
0017 % without explicitly (c)transposing arrays.
0018 %
0020
0021 % This file is part of Manopt: www.manopt.org.
0022 % Original author: Nicolas Boumal, Aug. 12, 2021.
0023 % Contributors: Xiaowen Jiang
0024 % Change log:
0025 %
0026 %   Aug. 12, 2021 (NB):
0027 %       Matlab R2020b introduced a built-in function pagectranspose which
0028 %       does essentially everything we ever needed to do with multihconj
0029 %       in Manopt. Accordingly, multihconj became a wrapper for
0030 %       pagectranspose, and the old code for multihconj remains available
0031 %       as multihconj_legacy.
0032
0033     assert(nargin == 1, ...
0034            'The new multihconj only takes one input. Check multihconj_legacy.');
0035
0036     if exist('pagectranspose', 'file') % Added to Matlab R2020b
0037         B = pagectranspose(A);
0038     else
0039     %   warning('manopt:multi', ...
0040     %          ['Matlab R2020b introduced pagectranspose.\n' ...
0041     %           'Calling the old code multihconj_legacy instead.\n' ...
0042     %           'To disable this warning: warning(''off'', ''manopt:multi'')']);
0043         B = multihconj_legacy(A);
0044     end
0045
0046 end```

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005