complex-numbers Questions

0

Taking as a basis the Atomic orbital example in the example gallery, I'm trying to visualize a 3D arbitrary complex field using an isosurface, in the way the cyclic HSV colormap illustrates the pha...
Theriot asked 13/7, 2021 at 11:53

5

Solved

How can I round up a complex number (e.g. 1.9999999999999998-2j) as 2-2j? When I tried using print(round(x,2)) it showed Traceback (most recent call last): File "C:\Python34\FFT.py", line 22...
Anamariaanamnesis asked 13/9, 2014 at 6:5

2

Solved

I'm getting a strange error in Python 3.8: When I run this calculation, I get a complex number: >>> (1.0 / (2.0 - 0.5222232592740141 * 92.16159106468214)) ** (1.0 / (10.0 + 1)) (0.67728505...
Haslet asked 1/4, 2021 at 10:54

2

I have a relatively simple complex sympy expression which one can easily read the coefficients off of the variables. However coeff function does not appear to be working correctly import sympy as ...
Corby asked 30/3, 2019 at 23:49

5

Solved

We do complex number multiplication as follows: (a + i * b) * (c + i * d) = (a * c - b * d) + i * (a * d + b * c) The real and imaginary parts of the result are real part = (a * c - b * d) imag...
Savoy asked 27/10, 2013 at 18:23

2

http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx C99 support added visual studio 2013, but I cant use complex.h in my "C" code. #include <stdio....
Velma asked 10/4, 2014 at 14:45

9

Solved

I want to combine 2 parts of the same array to make a complex array: Data[:,:,:,0] , Data[:,:,:,1] These don't work: x = np.complex(Data[:,:,:,0], Data[:,:,:,1]) x = complex(Data[:,:,:,0], Data[:,...
Featheredge asked 8/4, 2010 at 9:22

2

Solved

I've been trying to figure out the algorithm behind NumPy's matrix multiplication for complex numbers: import numpy as np A = np.array([[17.+0.j, -3.+0.j], [-7.+0.j, 1.+0.j]]) B = np.array([[ 6...
Anaplastic asked 11/5, 2020 at 18:34

4

Solved

I'm currently learning about discret Fourier transform and I'm playing with numpy to understand it better. I tried to plot a "sin x sin x sin" signal and obtained a clean FFT with 4 non-zero point...
Retroflexion asked 2/9, 2014 at 13:26

2

Solved

I have been testing an algorithm that has been published in literature that involves solving a set of 'm' non-linear equations in both Matlab and Python. The set of non-linear equations involves in...

2

Solved

I want to do some quantum mechanics calculations with PyTorch, where the quantities are sometimes complex. I would like to know how can I cast an existing real tensor to complex type.
Worriment asked 13/1, 2020 at 13:22

1

Solved

I'm trying to hunt down a problem using complex literals when compiling with GCC. Consider the following #include <stdio.h> #include <complex.h> int main(void) { double complex z = C...
Thora asked 19/11, 2019 at 15:35

3

I want to round the complex and real part upto 2 decimal points. How can I do that in python? angle = 2 * np.pi *2 c1 = complex(np.cos(angle),np.sin(angle)) c1 = round(c1,2)
Tarazi asked 9/8, 2019 at 13:42

2

Solved

I'm in need of a Meijer G function in scipy. I read somewhere on the internet that due to its generality, the Meier G function is not supported as a special function in scipy, but everyone should w...
Pacification asked 14/7, 2015 at 14:43

6

Solved

I am coding a simple DFT algorithm now and I want to use the complex number i in complex exponential. I saw somebody use #include<complex> and #include<cmath>, and then they used the ov...
Danutadanya asked 29/7, 2013 at 13:52

3

Solved

I want to repeatedly calculate a two-dimensional complex integral using dblquad from scipy.integrate. As the number of evaluations will be quite high I would like to increase the evaluation speed o...
Recapitulation asked 3/4, 2013 at 16:43

1

Solved

There do exists so-called hyperoperation sequence. It works like you construct multiplication a*b=a+a+a+a...+a with many additions of a repeated b times. Then there goes exponentiation a^b = a*a*a*...
Kraut asked 23/6, 2019 at 16:37

5

I know that if I want to save and load arrays of complex numbers with numpy, I can use the method described here: How to save and load an array of complex numbers using numpy.savetxt? . Assume ho...
Fumigate asked 20/2, 2017 at 15:47

5

Solved

I am creating a calculator application for all types of mathematical algorithms. However, I want to identify if a root is complex and then have an exception for it. I came up with this: if x == co...
Haileyhailfellowwellmet asked 21/3, 2012 at 23:54

4

Solved

How to print ( with printf ) complex number? For example, if I have this code: #include <stdio.h> #include <complex.h> int main(void) { double complex dc1 = 3 + 2*I; double complex d...
Wintertime asked 4/11, 2010 at 17:31

1

Solved

This code print *, sqrt(cmplx(-1)) print *, sqrt(cmplx(-1,0)) print *, sqrt((-1,0)) print *, sqrt(-(1,0)) gives me this output (0.00000000,1.00000000) (0.00000000,1.00000000) (0.00000000,1.0000...
Filiation asked 31/10, 2018 at 15:1

5

Solved

There is the complex<> template in C++ standard library, and it has an overloaded << operator so that it outputs complex numbers in the (real_part, im_part) format. I need to change the...
Interactive asked 14/2, 2011 at 6:59

4

I am doing something like: int real_part, imaginary_part; cout<<"Please enter realpart and imaginary part"<<endl; cin>>real_part; cin>>imaginary_part; complex<double>...
Piton asked 25/10, 2016 at 16:27

3

Solved

Since MATLAB R2018a, complex-valued matrices are stored internally as a single data block, with the real and imaginary component of each matrix element stored next to each other -- they call this "...
Mitchum asked 3/10, 2018 at 20:16

1

Solved

There seems to be a problem, using the literal i in C++ with std::complex. Consider the following code: std::complex<double> a = -1.0i * 42.0; std::complex<double> b = a + 1.0i; The...
Fluctuation asked 8/8, 2018 at 9:3

© 2022 - 2025 — McMap. All rights reserved.