Mathematical Functions and Constants #

FormulaGrader and NumericalGrader Default Functions #


Below, expressions marked with a * may require our AsciiMath renderer definitions to display properly in edX.

By default, all of the following functions are made available to students in FormulaGrader problems.

MatrixGrader Default Functions #

In MatrixGrader problems, all FormulaGrader functions are available by default, as are the following extra functions:

Default Constants #

Available in FormulaGrader, NumericalGrader, and MatrixGrader by default:

Optional Constant Collections #

We provide a few collections of constants that can be imported for convenience and reuse. For example, pauli is a dictionary with keys sigma_x, sigma_y, and sigma_z that are MathArray representations of the 2x2 Pauli matrices.

The collections of available mathematical constants are:

Each collection is a dictionary that can be provided as a value of user_constants:

>>> from mitxgraders import *
>>> grader = MatrixGrader(
...   answers='sigma_x + sigma_z',
...   user_constants=pauli
... )