![]() |
VOOZH | about |
A Complex Number is any number that can be represented in the form of x+yj where x is the real part and y is the imaginary part. Multiplication of two complex numbers can be done using the below formula:
NumPy provides vdot() method that returns the dot product of vectors a and b. It handles complex numbers differently than dot(a, b) by conjugating the first argument.
numpy.vdot(a, b)
Parameters:
Return Value: Returns a scalar which is the dot product of a and b. If the arrays contain complex numbers, a is conjugated before multiplication.
Example 1: This example demonstrates how to compute the dot product of two 1D arrays of complex numbers.
Matrix A: [2.+3.j 4.+5.j] Matrix B: [8.+7.j 5.+6.j] Result: (87-11j)
Explanation:
Example 2: This example demonstrates the dot product for 2D arrays of complex numbers.
Matrix A: [[2.+3.j 4.+5.j] [4.+5.j 6.+7.j]] Matrix B: [[8. +7.j 5. +6.j] [9.+10.j 1. +2.j]] Result: (193-11j)
Explanation: