# Complex number field

**URL:** <https://community.freefem.org/t/complex-number-field/1630>\
**Category:** General Discussion\
**Created:** [March 27, 2022, 12:12pm UTC](https://community.freefem.org/t/complex-number-field/1630 "2022-03-27T12:12:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 27, 2022, 12:12pm UTC](https://community.freefem.org/t/complex-number-field/1630/1 "2022-03-27T12:12:42Z")

</div>

The inner product is defined as follows, if you take the inner product over a complex field, does the test function have to be a conjugate function, is the inner product defined the same way?  
 ![屏幕截图 2022-03-27 200731](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/f/f0ef7b39d75843361676ebe7aa05c092386cd6fd.png)

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [March 28, 2022, 1:28pm UTC](https://community.freefem.org/t/complex-number-field/1630/2 "2022-03-28T13:28:08Z")

</div>

This is the L2 inner product for real functions. For complex functions, one would use a conjugate function.

> **[L^2-Inner Product -- from Wolfram MathWorld](https://mathworld.wolfram.com/L2-InnerProduct.html)**
>
> The L^2-inner product of two real functions f and g on a measure space X with respect to the measure mu is given by \_(L^2)=int\_Xfgdmu, sometimes also called the bracket product, where the symbol are called angle brackets. If the functions are...

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 29, 2022, 12:59am UTC](https://community.freefem.org/t/complex-number-field/1630/3 "2022-03-29T00:59:57Z")

</div>

Hello, in FreeFem++, does the programming language

> int2d(Th)(u\*v)

represent real-valued functions. But I see an example of a complex function, which is also

> int2d(Th)(u\*v),

which in fact should not be

> int2d(Th)(u\*conj(v))?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [March 31, 2022, 4:39pm UTC](https://community.freefem.org/t/complex-number-field/1630/4 "2022-03-31T16:39:46Z")

</div>

Yes but the test function is real so no conj .

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [April 1, 2022, 7:13am UTC](https://community.freefem.org/t/complex-number-field/1630/5 "2022-04-01T07:13:33Z")

</div>

I see. Thank you very much for your reply. 😄

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [April 2, 2022, 3:22am UTC](https://community.freefem.org/t/complex-number-field/1630/7 "2022-04-02T03:22:02Z")

</div>

Good morning, if the test function is a real function, then the stiffness matrix is real, but why define matrix complex\>A=va (Xh,Xh) rather than matrix A=va(Xh,Xh)?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 2, 2022, 10:08am UTC](https://community.freefem.org/t/complex-number-field/1630/8 "2022-04-02T10:08:15Z")

</div>

because the you get matrix coefficient as complex and not real.

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [April 2, 2022, 11:25am UTC](https://community.freefem.org/t/complex-number-field/1630/9 "2022-04-02T11:25:38Z")

</div>

Thank you for your reply. The problem has been solved.
