'how to generate uniform random complex numbers in python
For my research, I need to generate uniform random complex numbers. How to do this in python because there is no such module to generate the complex numbers.
Solution 1:[1]
Is it not enough to do:
a = np.random.uniform(1,10,10)
b = a + a * <some constant>j
I think this stays uniform.
array([7.51553061 +9.01863673j, 1.53844779 +1.84613735j,
2.33666459 +2.80399751j, 9.44081138+11.32897366j,
7.47316887 +8.96780264j, 6.96193206 +8.35431847j,
9.13933486+10.96720183j, 2.10023098 +2.52027718j,
4.70705458 +5.6484655j , 8.02055689 +9.62466827j])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andy |
