Skip to content

Commit

Permalink
Add example for degree_complex/halfdegree to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
projekter committed Mar 28, 2024
1 parent 65dc733 commit 1c9b144
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ end
Return the _total complex degree_ of the monomial of the term `t`, i.e., the maximum of the total degree of the declared
variables in `t` and the total degree of the conjugate variables in `t`.
To be well-defined, the monomial must not contain real parts or imaginary parts of variables.
If `x` is a real-valued variable and `z` is complex-valued,
- `degree_complex(x^5) = 5`
- `degree_complex(z^3 * conj(z)^4) = 4` and `degree_complex(z^4 * conj(z)^3) = 4`
- `degree_complex(x^5 * z^3 * conj(z^4)) = 5 + 4 = 9`
"""
degree_complex(t::AbstractTermLike)

Expand All @@ -253,6 +257,11 @@ degree_complex(t::AbstractTermLike)
Return the equivalent of `ceil(degree(t)/2)`` for real-valued terms or `degree_complex(t)` for terms with only complex
variables; however, respect any mixing between complex and real-valued variables.
To be well-defined, the monomial must not contain real parts or imaginary parts of variables.
If `x` is a real-valued variable and `z` is complex-valued,
- `halfdegree(x^5) = 3`
- `halfdegree(z^3 * conj(z)^4) = 4` and `halfdegree(z^4 * conj(z)^3) = 4`
- `halfdegree(x^5 * z^3 * conj(z^4)) = 3 + 4 = 7`
"""
halfdegree(t::AbstractTermLike)

Expand Down

0 comments on commit 1c9b144

Please sign in to comment.