RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.2, Nov 26, 2026 ·

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • cross
    • ctranspose
    • dot
    • mldivide
    • mpower
    • mrdivide
    • mtimes
    • pagemtimes
    • pagetranspose
    • trace
    • transpose

ctranspose — Conjugate-transpose arrays in MATLAB and RunMat.

B = ctranspose(A) (or A') swaps the first two dimensions of A and conjugates complex values. Real-valued inputs therefore behave like simple transpose, with MATLAB/RunMat Hermitian semantics for complex data.

Syntax

B = ctranspose(A)

Inputs

A
Type
Any
Required
Yes
Description
Input scalar/array value.
NameTypeRequiredDefaultDescription
AAnyYes—Input scalar/array value.

Returns

B
Type
Any
Description
Input value with first two dimensions swapped and complex conjugated.
NameTypeDescription
BAnyInput value with first two dimensions swapped and complex conjugated.

Errors

RunMat:ctranspose:InvalidArgument
When
Call does not provide exactly one input argument.
Message
ctranspose: invalid argument
RunMat:ctranspose:InvalidInput
When
Input type is unsupported for conjugate transpose, the input has a nonsingleton dimension above two, or the input uses complex integer storage.
Message
ctranspose: unsupported input type
RunMat:ctranspose:Internal
When
Runtime cannot materialize conjugate-transpose output.
Message
ctranspose: internal runtime failure
IdentifierWhenMessage
RunMat:ctranspose:InvalidArgumentCall does not provide exactly one input argument.ctranspose: invalid argument
RunMat:ctranspose:InvalidInputInput type is unsupported for conjugate transpose, the input has a nonsingleton dimension above two, or the input uses complex integer storage.ctranspose: unsupported input type
RunMat:ctranspose:InternalRuntime cannot materialize conjugate-transpose output.ctranspose: internal runtime failure

Behavior and supported arrays

B = ctranspose(A) (or A') swaps the first two dimensions and conjugates complex values. Real-valued input behaves like simple transpose. Scalars, vectors, matrices, and explicit trailing singleton dimensions are supported; N-D arrays with a nonsingleton dimension above two are rejected in favor of permute.

Real numeric, logical, and character entries are unchanged by conjugation. Complex single and double entries are conjugated and remain complex even when every imaginary component is zero. Complex integer storage is rejected. Empty arrays use column-major transpose semantics.

Dense real integer input retains all eight integer classes. Integer-valued sparse storage requires the ctranspose-integer-sparse RunMat extension. Character and cell arrays retain their types while entries move to transposed positions. String scalars pass through and string arrays transpose. Scalar structs are unchanged; struct arrays transpose. External objects may provide their own ctranspose method.

GPU residency and provider behavior

Real and complex provider-resident tensors use the exact provider's transpose or permute operation and, for complex input, its unary_conj hook when available. Single and double are the supported floating precisions; no broadcast or reduction is performed.

When a required hook is unavailable, RunMat gathers to host, conjugate-transposes, and attempts to re-upload. The result may remain on host if re-upload is unavailable. Complex fallback preserves interleaved storage metadata when the result remains complex. A partial transpose/conjugation hook failure selects the host fallback and emits a warning. The operation is a fusion boundary so downstream kernels see the new shape.

Examples

Conjugate transpose of a complex matrix

Z = [1+2i 3-4i; 5+0i 6-7i];
H = ctranspose(Z)

Expected output:

H =
   1 - 2i   5 - 0i
   3 + 4i   6 + 7i

Conjugate transpose of a real matrix equals the plain transpose

A = [1 2 3; 4 5 6];
B = ctranspose(A)

Expected output:

B =
     1     4
     2     5
     3     6

Conjugate transpose turns row vectors into column vectors

row = [1-2i, 3+4i, 5];
col = ctranspose(row);
size(col)

Expected output:

ans = [3 1]

Conjugate transpose of a complex scalar

z = 2 + 3i;
result = ctranspose(z)

Expected output:

result = 2 - 3i

Conjugate transpose of text data preserves characters

C = ['r' 'u' 'n'; 'm' 'a' 't'];
CT = ctranspose(C)

Expected output:

CT =
    'rm'
    'ua'
    'nt'

Conjugate transpose of a gpuArray

G = gpuArray(rand(1024, 64) + 1i * rand(1024, 64));
GT = ctranspose(G)

Using ctranspose with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how ctranspose changes the result.

Run a small ctranspose example, explain the result, then change one input and compare the output.

FAQ

How is ctranspose different from transpose?⌄

transpose (A.') swaps dimensions without conjugation; ctranspose (A') also conjugates complex values. For purely real data they are identical.

Does ctranspose change logical or character arrays?⌄

Only their layout changes. Values remain logical or character, and conjugation has no effect.

What about higher-dimensional arrays?⌄

Use permute for higher-dimensional arrays. ctranspose accepts vectors and matrices, including explicit trailing singleton dimensions, and rejects nonsingleton dimensions above two.

Does the result share storage with the input?⌄

An array transpose usually materializes a new arrangement. A provider may return a lazy view or alias for an identity-shaped result, so storage independence is not guaranteed; value semantics remain unchanged.

How are complex tensors handled on the GPU today?⌄

Complex gpuArray values use interleaved real/imaginary storage. Providers with transpose/permute and unary_conj hooks keep the conjugate transpose resident; fallback gathers and attempts to re-upload through the same complex storage metadata.

Will ctranspose fuse with neighbouring kernels?⌄

Conjugate transposes currently act as fusion boundaries so that shape changes are visible to downstream kernels.

Can I rely on ctranspose inside linear-algebra routines (e.g., Hermitian products)?⌄

Yes for the supported numeric, logical, character, string, cell, scalar-struct, sparse, and resident array forms described above. On those inputs it preserves the conjugate-transpose semantics required by idioms such as A' * A.

What error do I get for unsupported types?⌄

Supported scalar structs are unchanged by transpose. Unsupported value kinds raise ctranspose: unsupported input type ...; external objects can provide their own ctranspose method.

Related Linalg functions

Ops

cross · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Factor

chol · decomposition · decomposition.ctranspose · decomposition.mldivide · decomposition.mrdivide · decomposition.mtimes · decomposition.rdivide · decomposition.subsref · decomposition.times · decomposition.uminus · decomposition.uplus · eig · eigs · gmres · ichol · ilu · lu · ordeig · ordqz · ordschur · pcg · qr · qz · rsf2csf · schur · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Source you can read

Every RunMat function's source is public. Read exactly how ctranspose is executed, line by line, in Rust.

  • View the source for ctranspose in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Behavior and supported arrays
  • GPU residency and provider behavior
  • Examples
  • Conjugate transpose of a complex matrix
  • Conjugate transpose of a real matrix equals the plain transpose
  • Conjugate transpose turns row vectors into column vectors
  • Conjugate transpose of a complex scalar
  • Conjugate transpose of text data preserves characters
  • Conjugate transpose of a gpuArray
  • Using ctranspose with coding agents
  • FAQ
  • Related Linalg functions
  • Ops
  • Structure
  • Factor
  • Solve
  • Source you can read
  • About RunMat