Questions on Mathematica packages, which are self-contained bundles of Mathematica code that add new functions and other functionality.

learn more… | top users | synonyms (1)

4
votes
1answer
59 views

Change Notebook's Default Context

In my workflow, when testing/developing packages, It's an common situation to test internal packages functions that has been already loaded with the package, so they are in the ...
23
votes
1answer
735 views

Why are all the lines commented when I create a Mathematica script?

When I created a Mathematica script, I found that all my lines were commented out (when opened with vi or gedit or any other ...
4
votes
1answer
107 views

How can I temporarily suspend the Combinatorica package?

Sometimes after I load the Combinatorica package by entering Needs["Combinatorica`"], I need to use Mathematica for something like: ...
4
votes
1answer
71 views

User defined packages don't load with $\mathtt{Needs}$ or $\mathtt{Get}$

As an introduction to packages in Mathematica I'm following this short guide by Leonid Shifrin, and tried using the sample package provided in that answer. However, both ...
1
vote
1answer
39 views

How to reference StringExpression named parts from a package without full Context path?

I have a long StringExpression in a package returned by a function. There are some named parts in the expression that I would like to reference when I use the ...
2
votes
1answer
60 views

Removing commands used before loading package

Original Question: I used the convert command before loading the Units package. Convert[20000. Feet, Mile] Since Convert ...
3
votes
1answer
54 views

How to use special characters in .m file?

I ran into a strange problem with a function that I want to include in a package file (.m): Cleanup[data_] := data /. (\[Placeholder] -> Missing[]) When I ...
0
votes
1answer
44 views
5
votes
2answers
90 views

Strange behaviour of order of execution or bug?

In[1] and In[3] are identical but the output is different.
6
votes
1answer
81 views

Installing packages on “Mathematica Online”

How can I install packages in Mathematica Online? In particular, how can I install the xAct package?
3
votes
0answers
28 views

Context is not clearable and does not reload [closed]

I'm just going crazy with Mathematica Contexts as they absolute do not work as intended. Simple Example: Begin["TEST`"] Hello[s_]:=s Bye[s_]:=s End[] Now using ...
5
votes
0answers
41 views

Mathematica package for explicit matrix representations of group generators?

While there are several packages that are capable of working with weights and roots (for example LieArt), I couldn't find any package that spits out explicit matrices for the generators, for example ...
2
votes
1answer
149 views

Saving file as .m causes it to save as comments

I am attempting to create a Package and so am saving a notebook with the code from Mathematica's example ...
1
vote
1answer
54 views

Differentiation inside package

I am trying to put all my functions in a single package and some of them do not work because of differentiation. Suppose I have the following package ...
7
votes
2answers
128 views
8
votes
2answers
108 views

Coding practice Notebooks vs. Packages: ClearAll?

I have a pretty robust workflow for developing in Notebooks. One element of that workflow is the reflexive habit of saying ClearAll just before a definition so ...
0
votes
0answers
66 views

Installing the HypExp package

I am trying to download the package HypExp for expanding hypergeometric functions in terms of logs and polylogs. As far as I understand and read from online, one way to do this is to go to File then ...
9
votes
3answers
739 views

Can't load LevelScheme package

I am trying to use Mark Caprio's LevelScheme package for customizing graphics, but I haven't been able to get Mathematica to load the package using Get or ...
9
votes
2answers
183 views

How to define UpValues in a different context from within a package

I'm trying to create a function (in a package) to import a lot of data and create a symbol with UpValues to return specific results about the data. I've got it working fine in a regular notebook, but ...
3
votes
2answers
82 views

Use of Ito's lemma in ItosLemma.m (or any other method in Mathematica)

This is a follow-up question on this question: Use of Ito's lemma in ItoProcess My problem is to find some method how to use Ito's lemma in Mathematica. As an example: How can I apply Ito's ...
1
vote
0answers
35 views

Sum of zeros in finite Galois field

In the following code: << FiniteFields` GF[2][{0}] + GF[2][{0}] == GF[2][{0}] GF[2][{0}] + GF[2][{0}] + GF[2][{0}] == GF[2][{0}] Why does the second line ...
11
votes
2answers
576 views

FiniteFields package is very slow. Any fast substitute for Mathematica?

I want to compute the inverse of matrix, say with dimensions $100 \times 100$, defined over a large finite field extension such as $GF(2^{120})$. I am using the package FiniteFields, but Mathematica's ...
3
votes
0answers
113 views

StyleSheet for custom application

I'm working on a package that needs to be installed into an arbitrary, "non standard" path (i.e., not $BaseDirectory or ...
4
votes
1answer
71 views

What is the difference between Update, Run Package, Save and Install for packages?

I am building a package, using Mathematica 10.0.2.0. I notice in the displayed window for the package there are buttons labeled Update and Run Package; on the File menu, there is an item for Save; ...
3
votes
0answers
37 views

Cross referencing symbols in different packages [duplicate]

I have problems with name space shadowing which I do not know how to resolve. I have two packages which depend on each other. Here is example of two files fooPackage.m: ...
5
votes
1answer
102 views

Working example for the built-in SavitzkyGolayMatrix for doing polynominal smoothing

Have been using various packages SavitskyGolay.m for Savitsky-Golay polynomial smoothing but just noticed the built-in matrix kernel. I am looking for an example ...
12
votes
2answers
267 views

Is there a bug in AssociatePairs?

Bug introduced in 10.0 and fixed in 10.1.0 In Version 10, the GeneralUtilities package contain some useful functions. ...
0
votes
1answer
123 views

Traces of products of Gell-Mann matrices in FeynCalc

I am working on an assignment in FeynCalc and I need to evaluate traces of products of two commutators of Gell-Mann (SU(3)) matrices, i.e. I need to calculate the ...
6
votes
1answer
93 views

How can I include functions from a package into a CDF file?

I am building an application which I would like to deploy as a CDF file, and I am struggling to make the CDF exports work correctly with functions pulled from a .m package file. What are good/best ...
19
votes
3answers
759 views

How to program a F::argx message?

How useful is it to program a user-built function in a package to produce a red warning message F::argx if you give the wrong number of arguments to that function? ...
3
votes
0answers
102 views

Are there any build-in or third-party packages for general topology or algebraic topology in Mathematica?

I am learning general topology (wiki) and algebraic topology (wiki). Are there any build-in or third-party packages for general topology or algebraic topology in Mathematica? Through googling, ...
4
votes
1answer
140 views

Can I do constraint programming in Mathematica? [closed]

I would like to know if there is a way to do constraint programming in Mathematica? I think there are no built-in functions, but maybe some of you know some additional packages addressed to the ...
0
votes
0answers
50 views

Setting UserBaseDirectory for custom packages

Is there any reason to set UserBaseDirectory to be anything other than the default? On my mac its set as ~/Library/Mathematica. It's been suggested that I should change this, and then add my own ...
2
votes
1answer
66 views

Needs cannot open a package

I have a package and notebook in the same directory, but Needs is throwing an error "Cannot open EField.m". I have tried several variations of this. I am ...
0
votes
0answers
20 views

How to protect variables or functions only for outside? [duplicate]

I have some private variables within my package. Begin['Test`']; Begin[`Private`]; var = 0; f[x_]:=(var = x); End[]; EndPackage[]; When I execute some functions ...
0
votes
0answers
27 views

How can I avoid to define public all methods in a package [duplicate]

If I have to code a Package and these package use a lot of functions and variables. In spite of, using in every call of function or variable with namePackage ...
5
votes
1answer
74 views

Shadowing of optional function arguments?

I am trying to define two different packages that process some information in a different way. These packages have functions into them with optional arguments. The names of the optional arguments ...
5
votes
1answer
89 views

Naming conflicts with Dummy variables in several packages conflicts

I'm using several packages in a notebook. In each packages there is functions defined with dummy variables. When I load the several packages in my session, i've got a warning message: ...
4
votes
1answer
201 views

Possible Bug of loading Package @ Mathematica 10.1

When I open mathematica, there will pop-up some messages where << package` is in the following file ...
0
votes
1answer
99 views

Solve seems broken after I installed the package Tomatlab.m

After I downloaded the Mathematica package ToMatlab.m, Solve does not work as before: ...
29
votes
1answer
729 views

Proving the hairy ball theorem using xAct

I would like to formally prove the hairy ball theorem in Mathematica, initially just for $S^2$, and then see about generalizing. An approach I thought about to use the xAct package to define $S^2$ ...
6
votes
0answers
102 views

Where is f2mma.zip, Fortran to Mathematica converter?

I want to convert the SOFA libraries to Mathematica, and found out about f2mma, a Fortran to Mathematica converter. Google points to many papers about f2mma, but the only link to the software ...
2
votes
1answer
103 views

AutoGeneratedPackage Formatting

If you do Ctrl+Shift+o you open an option inspector. And then you can enable ...
2
votes
2answers
88 views

Partial reload of definitions from package

In order to keep my code modular, I have defined some functions in "Foo.wl" file, which I source with Needs["Foo`"]. When I modify a single function in Foo, I quit ...
17
votes
0answers
236 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
2
votes
1answer
52 views

Missing definition of some parts of function?

I have: BeginPackage["Test1`"]; ClearAll[f]; f::usage = ""; Begin["`Private`"]; f[x_AA]:= 1; f[x_BB]:= 2; End[]; EndPackage[]; When later, on a notebook, after ...
0
votes
0answers
80 views

EquationTrekker PropertyValue errors

In Mathematica 10.0.2, the basic example for EquationTrekker in the documentation is: ...
8
votes
1answer
127 views

What's the goal of the Macros` package?

I see in the Mathematica install a Macros` package. In windows the paths is for example: ...
4
votes
0answers
40 views

Odd behavior of FindFile

Running FindFile gives some odd results on my machine: FindFile["HTTPClient`"] Result: ...