# Introduction to Mathematica, 5 credits

*Introduktion till Mathematica*

## COURSE INFORMATION

**Language of instruction:** English

**Course period:** Fall Semester 2022, Period 1

**Campus teaching or online teaching:** On campus

## RECOMMENDED PREREQUISITES

Students should be familiar with linear algebra, calculus and basic programming. No previous knowledge of *Mathematica* is assumed.

## LEARNING OUTCOMES

By the end of the course, students will be able to:

1. Account for the basic structure of computer algebra systems

2. Implement various algorithms in the *Mathematica* language

3. Compare and contrast different programming styles

4. Use efficiently functional and rule-based programming

5. Understand how the *Mathematica* kernel evaluates expressions

6. Test and optimize *Mathematica* code

7. Design and set up their own *Mathematica* packages

8. Apply symbolic programming to their research

## LEARNING OUTCOMES FOR DOCTORAL DEGREE

According to the learning outcomes for a doctoral degree, a doctoral candidate should ”demonstrate broad knowledge and systematic understanding of the research field”. Computer algebra systems and symbolic computation are a field that lies at the intersection of Mathematics and Computer Science. As such, the course allows students in certain fields (mainly Mathematics, Information Technology and Theoretical/High Energy Physics) to gain deeper knowledge of an important (and growing) part of their field.

Additionally, a doctoral student should, ”demonstrate familiarity with research methodology in general and the methods of the specific field of research in particular”, as well as ”demonstrate the ability to [...] plan and use appropriate methods to undertake research”. Scientific programming in general and symbolic calculation with *Mathematica* in particular are necessary tools/methods for undertaking research in many fields in TekNat. These include, aside from Mathematics, Physics and Information Technology, also Chemistry, Biology, Engineering. In this respect, the course is designed to directly help students apply what they have learned to their research (e.g. the final project needs to be related to the student’s research).

## COURSE CONTENTS

1. An introduction to computer algebra systems and symbolic programming

2. The basics of *Mathematica* as a programming language (symbolic expressions, vectors and matrices, conditional expressions, loops)

3. Substitutions and patterns

4. Linear algebra and calculus with *Mathematica*

5. Different programming styles in *Mathematica*: procedural, functional and rule-based programming

6. Kernel evaluation.

7. *MathLink* interface (how to install C/C++ functions into *Mathematica*)

8. Elements of optimization, parallel programming

9. Writing your own *Mathematica* package

10. Applications relevant to research in Mathematics, Physics, Chemistry and Biology (total of 6 lectures)

Applications discussed during the course will depend on the participants' interests. As an example, the 2021 iteration of the course (which is being given at the moment of this writing) includes the following:

- Polynomial reduction and Gröbner basis. Of interest for everybody.
- Studying molecular conformations with
*Mathematica*, including graphical methods. Of interest for Chemists. - Optimization methods and linear programming. Of interest for Chemists/Physicists/Engineers.
- Evolutionary models with
*Mathematica*, including analytic tools for solving differential equations (Guest lecture from Prof. Sylvain Glemin, Department of Ecology and Genetics).

These topics are sufficiently broad that participants from different departments can all benefit from the lectures. Additional topics can be included according to students’ interests, such as data analysis with *Mathematica* and machine learning. Moreover, additional applications will be covered in the three exercise sessions.

Textbooks:

- P. Wellin, ”Programming with Mathematica: An Introduction”, Cambridge University Press, 2013
- Andrey Grozin, ”Introduction to Mathematica for Physicists”, Springer, 2014;

Useful reference:

- Wagner, ”Power Programming with Mathematica: the Kernel, McGrawHill, 1996

Lecture notes will be handed out during the course.

The course exists also as a master course with code 1FA164; this application asks for funds to support participation of doctoral students and, in particular, to deliver lectures focusing on applications of *Mathematica* outside of Physics, which are necessary for targeting doctoral students across the Faculty (including guest lectures). In 2022 two extra lectures focusing on additional applications will be added, including possibly a second guest lecture.

## INSTRUCTION

– 13 lectures (26 h total)

– 3 problem-solving sessions in which students work in groups

– 3 additional overview sessions held at the beginning of the course to support students who need some extra help with the material (e.g. students who never used *Mathematica* before).

The group-work component consists of students working in teams for the problem-solving sessions. In this way, my course provides an opportunity to develop teamwork skills in the context of interdisciplinary collaborative work (groups contain students from different departments/sections).

At the same time, 50% of the student final grade comes from an individual final project. This gives students an opportunity to apply the course content to their own research and to receive individual feedback.

The structure of the course is meant to be flexible and adaptable to students coming from different departments and having different levels of proficiency in *Mathematica*. Extra tutorials are geared at assisting students who have never used *Mathematica* before. Some advanced topics, for example interfacing *Mathematica *and C/C++ are meant for more advanced users. The choice of topics for the lectures focusing on applications (4 in 2021, 6 in 2022) will be done according to student interests.

– 13 lectures (26 h total)

– 3 problem-solving sessions in which students work in groups

– 3 additional overview sessions held at the beginning of the course to support students who need some extra help with the material (e.g. students who never used *Mathematica* before).

The group-work component consists of students working in teams for the problem-solving sessions. In this way, my course provides an opportunity to develop teamwork skills in the context of interdisciplinary collaborative work (groups contain students from different departments/sections).

At the same time, 50% of the student final grade comes from an individual final project. This gives students an opportunity to apply the course content to their own research and to receive individual feedback.

The structure of the course is meant to be flexible and adaptable to students coming from different departments and having different levels of proficiency in *Mathematica*. Extra tutorials are geared at assisting students who have never used *Mathematica* before. Some advanced topics, for example interfacing *Mathematica *and C/C++ are meant for more advanced users. The choice of topics for the lectures focusing on applications (4 in 2021, 6 in 2022) will be done according to student interests.

## ASSESSMENT

Group work (50%) individual project (50%).

## COURSE EXAMINER

Marco Chiodaroli, marco.chiodaroli@physics.uu.se

## DEPARTMENT WITH MAIN RESPONSIBILITY

Physics and Astronomy

## CONTACT PERSON/S

Marco Chiodaroli, marco.chiodaroli@physics.uu.se

## APPLICATION

Submit the application for admission to: marco.chiodaroli@physics.uu.se

Submit the application not later than: June 15, 2022