SymbolicC++

Uses your system voice; voice and rate in settings.

Q7661159Snapshot

≈ 3 min read

Names in other languages

  • caSymbolicC++
  • DeutschSymbolicC++
  • EnglishSymbolicC++
  • EspañolSymbolicC++
  • FrançaisSymbolicC++
  • ItalianoSymbolicC++
  • PortuguêsSymbolicC++
  • RomânăSymbolicC++

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

SymbolicC++ is a general purpose computer algebra system written in the programming language C++. It is free software released under the terms of the GNU General Public License. SymbolicC++ is used by including a C++ header file or by linking against a library.

SymbolicC++ is a general purpose computer algebra system written in the programming language C++. It is free software released under the terms of the GNU General Public License.

SymbolicC++ is used by including a C++ header file or by linking against a library. import "symbolicc++.h"; import std; using namespace std; int main() { Symbolic x("x"); std::println("{}", integrate(x+1, x)); // => 1/2*x^(2)+x Symbolic y("y"); std::println("{}", df(y, x)); // => 0 std::println("{}", df(y[x], x)); // => df(y[x],x) std::println("{}", df(std::exp(std::cos(y[x])), x)); // => -sin(y[x])*df(y[x],x)*e^cos(y[x]) return 0; } The following program fragment inverts the matrix \begin{pmatrix} \cos\theta & \sin\theta\\ -\sin\theta & \cos\theta \end{pmatrix} symbolically. Symbolic theta("theta"); Symbolic r = { { std::cos(theta), std::sin(theta) }, { -std::sin(theta), std::cos(theta) } }; std::println(r(0, 1)); // sin(theta) Symbolic rInv = r.inverse(); std::println(rInv[ (std::cos(theta) ^ 2) == 1 - (std::sin(theta) ^ 2) ]); The output is [ cos(theta) −sin(theta) ] [ sin(theta) cos(theta) ] The next program illustrates non-commutative symbols in SymbolicC++.

Here b is a Bose annihilation operator and bd is a Bose creation operator. The variable vs denotes the vacuum state |0\rangle .

The ~ operator toggles the commutativity of a variable, i.e. if b is commutative that ~b is non-commutative and if b is non-commutative ~b is commutative. import "symbolicc++.h"; import std; int main() { // The operator b is the annihilation operator and bd is the creation operator Symbolic b("b"); Symbolic bd("bd"); Symbolic vs("vs"); b = ~b; bd = ~bd; vs = ~vs; Equations rules = (b * bd

bd * b + 1, b * vs

0); // Example 1 Symbolic result1 = b * bd * b *bd; std::println("result1 = {}", result1.subst_all(rules)); std::println("result1 * vs = {}", (result1 * vs).subst_all(rules)); // Example 2 Symbolic result2 = (b + bd) ^ 4; std::println("result2 = {}", result2.subst_all(rules)); std::println("result2 * vs = {}", (result2 * vs).subst_all(rules)); return 0; } Further examples can be found in the books listed below. import "rational.h"; import "msymbol.h"; import std; int main(void) { Sum x("x", 1); Sum > y("y", 1); std::println("{}", Int(y, y)); // => 1/2 yˆ2 y.depend(x); std::println("{}", df(y, x)); // => df(y,x) return 0; } The second version of SymbolicC++ featured new classes such as the Polynomial class and initial support for simple integration. Support for the algebraic computation of Clifford algebras was described in using SymbolicC++ in 2002.

Subsequently, support for Gröbner bases was added. The third version features a complete rewrite of SymbolicC++ and was released in 20081. This version encapsulates all symbolic expressions in the Symbolic class.

Newer versions are available from the SymbolicC++ website.

See also

Comparison of computer algebra systems GiNaC

Text derived from https://en.wikipedia.org/w/index.php?oldid=1329883521 under CC BY-SA 4.0; modifications have been made.

References

  1. ↩Wikipedia “SymbolicC++” revision 1329883521 · retrieved 2026-10-20 release date (×1) · confidence 0.95 revision URL