2 from complex
import ascomplex, imag, real
6 rng = np.random.default_rng()
10 Z = np.zeros((rows, cols), dtype=dtype)
11 Z.real = rng.random((rows, cols))
12 Z.imag = rng.random((rows, cols))
15 assert (Z_real == Z.real).all()
17 assert (Z_imag == Z.imag).all()
19 Y = np.ones((rows, cols))
21 assert (Y_complex.real == Y).all()
22 assert (Y_complex.imag == np.zeros((rows, cols))).all()