Skip to main content

Questions tagged [complex-arithmetic]

For questions about implementing and using complex arithmetic operations.

Filter by
Sorted by
Tagged with
3 votes
1 answer
121 views

2x2 complex symmetric eigendecomposition - LAPACK subroutine CLAESY

Asking here because I searched the LAPACK user forums and found nothing. I have a problem that requires the computation of the eigendecomposition $A=A^T=Q \Lambda Q^T$ for the 2x2 complex symmetric ...
coolguy1000000's user avatar
0 votes
1 answer
58 views

Finding best phase in least-squares manner

I have the following problem: $$argmin_{\vec{x},\phi}||A\vec{x}-\vec{y}e^{j\phi}||_2^2$$ Here, $x$ and $y$ are vectors and $\phi$ is a constant phase factor that applies to the all entries of $y$. I ...
starhd's user avatar
  • 23
1 vote
0 answers
63 views

Does the choice of a complex inner product affect Krylov methods?

As far as I understand there are two definitions of the complex inner product: $$(a,b) = b^H a$$ and $$(a,b) = a^H b$$ I know some linear algebra libraries such as BLAS and Eigen uses the second one. ...
Alexandre Hoffmann's user avatar
-2 votes
1 answer
49 views

Simplification of complex amplitudes

In a previous answer the following identity was presented $$-i \vec \kappa \exp^{[i\vec \kappa \cdot (\vec r_j - \vec r_i)]} = -\vec \kappa \sin[\vec \kappa \cdot (\vec r_j - \vec r_i)] \, .$$ Why ...
Zhao Dazhuang's user avatar
1 vote
1 answer
84 views

Why does this implementation for Eisenstein integer pairs of Euclid's method for finding greatest common denominators get stuck for this one point?

My Math SE question determining if a coincident point in a pair of rotated hexagonal lattices is closest to the origin? explains the problem I have. I won't reproduce the whole thing in detail here, ...
uhoh's user avatar
  • 1,088
2 votes
1 answer
506 views

Solving Schrodinger Equation with finite element and Crank-Nicolson?

I have asked this in Mathematic section, but received no reply. Please let me ask here to see if threr is any difference. The Schrodinger equation without potential has the following form: $$\...
WhatsupAndThanks's user avatar
4 votes
0 answers
217 views

Stable iterative solver for complex symmetric linear systems

I am interested in the iterative solution (preferably Krylov-type solvers) of a problem $\boldsymbol{A}x=b$, with $x,b\in\mathbb{C}^{n\times1}$ and $\boldsymbol{A}\in\mathbb{C}^{n\times n}$. $\...
Breno's user avatar
  • 141
2 votes
1 answer
303 views

Methods to improve the efficiency and the memory requirement of LU factorization for complex symmetric system matrix

I want to solve a linear set of equations (Ax=b) using LU decomposition. My "A" matrix is a complex matrix which is ...
HKK's user avatar
  • 33
0 votes
0 answers
52 views

Split of complex parts in weak form

I am working on a numerical model to simulate the acoustic and elastic wave propagation in frequency domain via the Finite Element Method. Basically, the problem is to solve the Helmholtz equation in ...
Lucas Vieira's user avatar
2 votes
1 answer
433 views

Reference for QR algorithm for complex matrix

I am trying to find out if the known QR algorithm to find the eigenvalues of a real matrix, which can be found in the book Fundamentals of Matrix Computations, can also be used for complex matrices ...
danft's user avatar
  • 31
6 votes
3 answers
301 views

Fast evaluation functions given by straight-line programs

I have a simple but long function that takes a vector x[10], and outputs a vector y[100]. It is an automatically generated eval function for a multivariate polynomial, ie, there is only (complex) ...
rfabbri's user avatar
  • 129
7 votes
2 answers
155 views

Algebraic multigrid for complex valued matrices

Assume one uses the classical AMG with Ruge-Stuben coarsening and direct interpolation for solving real valued problems. How can this approach be recycled to also solve complex valued problems like ...
vydesaster's user avatar
1 vote
1 answer
547 views

Computing real normal modes from complex eigenvectors

I'm trying to get the normal modes of a system of springs and dasphots using the basic dynamic equations for a linear, damped elastic structure: $ M \ddot{u}(t) + C \dot{u}(t) + K u(t) = f(t) $ to ...
Msegade's user avatar
  • 173
6 votes
2 answers
1k views

Complex Eigenvalues using eig (Matlab)

I wanted to find and plot the eigenvalues of large (around $1000\times1000$) matrices. But discovered when using the eig function in matlab, it gives complex ...
I Amx's user avatar
  • 61
8 votes
3 answers
1k views

Power of complex-valued neural network

I often see neural networks extended to complex-values. Those networks allow complex input, complex parameters, and complex output. My understanding is that the inner products and point nonlinearities ...
Memming's user avatar
  • 880
1 vote
1 answer
154 views

Mapping from n x n complex symmetric tridiagonal to 2n x 2n real symmetric tridiagonal

In my program I have a complex symmetric tridiagonal matrix. In order to perform some algorithmic optimizations I am searching for a (ideally linear) mapping from $n\times n$ complex symmetric ...
Sebastian's user avatar
6 votes
1 answer
123 views

Numerical computation of the complex elliptic integral $E(k)$ for medium $|k|$

I have implemented Carlson's algorithm for $E(k)$ from Numerical computation of real or complex elliptic integrals (available from ArXiv eprint, see also DLMF). It is essentially his formula (46) ...
gammatester's user avatar
3 votes
0 answers
145 views

What is the computational cost of using complex numbers in contrast to real numbers in matrix operations, e.g. $LU$ or $LDL^T$ factorizations? [duplicate]

I am curious about how much one loses in terms of computational cost when complex numbers are used instead of real numbers? I guess the number of floating-point operations and memory doubles, but I ...
Armut's user avatar
  • 245
2 votes
0 answers
520 views

Arpack and Matlab give different values for eigenvalues

I am solving a generalized eigenvalues problem with inversed complex shift: $$(M-\sigma J)^{-1}J \boldsymbol{x} = \boldsymbol{x} \nu \enspace .$$ My matrices are obtained from a finite element ...
Britomarti's user avatar
12 votes
2 answers
665 views

Danger of complex arithmetic in scientific computing

The complex inner product $\langle u,v\rangle$ has two different definitions decided by conventions: $\bar{u}^Tv$ or $u^T\bar{v}$. In BLAS, I found the routines ...
Hui Zhang's user avatar
  • 1,319
1 vote
1 answer
304 views

OpenMP threaded nonlinear solver for complex numbers

Problem: I have translated Jacobian-Free Newton-Krylov solver written by C. T. Kelley to Fortran and now want to parallelize it on a shared-memory system with OpenMP. In addition, I want to ...
Juris's user avatar
  • 11
6 votes
1 answer
557 views

Reference BLAS/LAPACK from NETLIB is twice as fast as MKL for complex numbers

I'm solving the Helmholtz equation using PETSc. I found with the PETSc configure option --download-f-blas-lapack my program runs twice as fast over running it with ...
Hui Zhang's user avatar
  • 1,319
16 votes
3 answers
2k views

Why would a computational scientist need to implement their own version of std::complex?

Many of the better-known C++ libraries in computational science such as Eigen, Trilinos, and deal.II use the standard C++ template header library object, ...
Aron Ahmadia's user avatar
  • 6,911
2 votes
1 answer
656 views

Implicitly casting PetscReal to the real part of PetscComplex

The version of PETSc installed on my machine has PetscScalar set to be complex. I am making a matrix which has all real entries. Something like the following code ...
Dan's user avatar
  • 3,355