Maple Kernel for Jupyter - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Jupyter : Maple Kernel for Jupyter

Overview of the Maple Kernel for Jupyter

 

Description

Running Jupyter with a Maple Kernel

Accessing Output from Other Cells

Special Code Cell Types

Output Display

Security

Details

Description

• 

The Maple Kernel for Jupyter is a utility bundled with Maple which enables the use of Maple computations within the Jupyter interactive computing platform (https://jupyter.org/), specifically Jupyter Notebook or JupyterLab.

• 

For details on configuring the Maple Kernel for Jupyter to work with a Jupyter installation, see Configuring the Maple Kernel for Jupyter.

Running Jupyter with a Maple Kernel

• 

A Jupyter session with the Maple kernel is similar to the experience of other Jupyter kernels and uses the REPL (Read, Evaluate, Print, Loop) paradigm.

• 

The user interacts with a notebook document which can contain text, images, or media as well as code cells.

• 

The code cells accept Maple code input in a manner similar to Code Edit Regions in a Maple worksheet. The syntax accepted is identical to the normal Maple programming language.

• 

There is an active Maple engine associated with the session while it is open. Execution of a code cell results in the code being executed in Maple, after which the results are displayed to the user in Jupyter.

Accessing Output from Other Cells

• 

Each code cell has an integer index which is updated when it is executed. This automatically updates two global tables in the Maple session, called In and Out respectively, using the index of the code cell. Thus you can easily reference previous computations in Maple input.

• 

The ditto operators (%,%%, and %%%) are not guaranteed to give the same results as they would when evaluating the equivalent computation in a Maple worksheet. The Out table is a more reliable way to access the output of other cells.

Special Code Cell Types

Help Links

• 

If the first character in a code cell is a ?, it is assumed to be a Maple help query. Evaluating the cell will produce a hyperlink to a relevant help page on the Maplesoft website.

  

Example (to be executed in a Jupyter code cell)

?solve,details

Python Cells

• 

If the code cell content begins with the string %python , the rest of the cell is interpreted as Python code and will be evaluated with Python[EvalString] using Maple's built-in Python engine. The state of this Python session can be accessed from normal Maple code cells using the Python package in the normal way.

  

Example (to be executed in a Jupyter code cell)

%python import numpy as np

%python x = np.array([1, 2, 3, 5])

%python v = np.vander(x, 4)

convert( Python:-EvalString("v"), Matrix );

Output Display

• 

Mathematical expressions (e.g. formulae, equations, vectors and matrices, and most expressions of type algebraic) will generally be rendered in Jupyter using LaTeX. There may be differences in the presentation between this and the display in the Maple graphical user interface.

• 

Some expressions, such as strings or data structures containing strings, are rendered in plaintext.

• 

The Jupyter[SetOutputRendererByType] command can be used to control the media type used to render output matching a given Maple type.

• 

Maple 2-D and 3-D plots will be rendered in Jupyter using static images.

Security

• 

By default Jupyter and all its installed kernels, including Maple, have whatever access to the file system the current user has. Thus care should be taken to prevent any unauthorized access to the machine on which it is running.

Details

• 

The Jupyter kernel for Maple connects to Maple using the OpenMaple C API.

See Also

Formats/Jupyter

Jupyter/package

Jupyter[SetOutputRendererByType]

Worksheet[WorksheetToJupyter]