Questions tagged [packages]

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

Filter by
Sorted by
Tagged with
9
votes
3answers
1k views

Simplifying the trace of a matrix expression

I have a long expression involving matrices that I derived using the NCAlgebra package. Can I simplify the trace of the expression? For example, say b is a scalar (...
9
votes
2answers
241 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 ...
9
votes
2answers
260 views

How to hide functions in a sub package from user level?

The only packages I did before were simple one file packages. I am now learning how to make a package that has a sub package. The main package calls functions in the subpackage. But user is not ...
9
votes
1answer
157 views

Why are some functions available without having to load their parent package?

Functions such as GraphDistanceMatrix[] or AdjacencyMatrix[] are available without invoking ...
9
votes
1answer
567 views

How to provide your own example data for a custom package?

A nice feature of the mathematica documentation is the copious use of ExampleData in illustrating functionality. I would like to provide some example data for a ...
9
votes
1answer
1k views

Import another Notebook as if it were a Package

Is it possible to import the contents of another (existing) notebook into the current namespace in the same way that I can with a package? I know that it would be best to use a ...
9
votes
1answer
465 views

Same name for functions in package and Global context

I am using a package that was written for Mathematica 3 while I am now working on Mathematica 8. I have issues with 2 functions in particular, Order and GraphComplement. They are a part of this ...
9
votes
1answer
152 views

Importing Packages to .wls without shadow definitions and context specification

I am trying to import a package that works correctly when I use it in a notebook in a wolframscript .wls. I get a weird shadowing problem, however. Here is a minimal working example ...
9
votes
2answers
453 views

Problem with PlayerPro recognizing a proprietary package

This question follows on from my earlier question Can Wolfram's Player Pro Use Proprietary Packages. That question appeared to have established that, yes, PlayerPro can use proprietary packages. Hmmm.....
9
votes
1answer
3k views

FeynRules vs FeynCalc (or anything else?)

I was looking for a Mathematica package that can take Lagrangians and calculate Feynman diagrams for any given n-point function. (..like if a software can draw and calculate arbitrary loop corrections ...
9
votes
2answers
2k views

Coordinate free differential forms package

I am looking for a package in Mathematica which can handle differential forms in a coordinate free manner. I am aware of several packages which do differential forms, but it seems that for all of them ...
9
votes
2answers
819 views

Any packages for vertex enumeration on Mathematica?

My work requires me to enumerate all vertices of a polytope defined by linear inequalities from time to time. And I'm mainly working with _Mathematica 9.0 on Mac OS X 10.9. So I wonder are there any ...
9
votes
2answers
9k views

Command line execution of Mathematica notebooks and conversion to .m

Sometimes one may want to execute a notebook via the command line (for example to run it remotely). As far as I know it's not possible to run notebooks directly, but ...
9
votes
1answer
2k views

How can I get Mathematica to recognize the documentation for a newly installed package?

To install a new package on one's machine, one first downloads and unpacks the package into the $BaseDirectory/Applications directory. The tutorial Installing ...
9
votes
1answer
225 views

Automatization of SyntaxInformation and argx?

Does anybody have a good way to automate the setting of SyntaxInformation for any custom function? I have a ton of functions for which I want to set SyntaxInformation, and doing it by hand seems a ...
8
votes
2answers
1k views

How to unprotect a variable in a package

In Mathematica 9, I had the function(s). I apologize for the weak formatting. ...
8
votes
3answers
2k views

How can I make private functions inside packages

I want to make private functions.for that purpose,I wrote the following code. BeginPackage["Test1`"] Begin["`Private`"] function1[x_]:=x End[] EndPackage[] I ...
8
votes
2answers
2k views

Time-frequency analysis beyond wavelets

What possibilities are there for time-frequency analysis in Mathematica beyond wavelet decomposition? I could not even find a simple STFT.
8
votes
3answers
225 views

Re-encode text file to use Mathematica's character name, like \[Alpha]

How can I re-encode a text file (or string) so that non-ASCII characters will be represented using Mathematica's standard names? For example, if the original contents of the file was ...
8
votes
1answer
403 views

Where does a package have to be loaded?

I'm trying to solve a very tricky issue in my function. The function needs the NDSolve`FEM` framework. Here is a minimal example: ...
8
votes
1answer
729 views

Using the variable in the MATLAB workspace using MATLink or any other packages

I have a program in MATLAB and after I run the program, I get some results in MATLAB's workspace. Now, I need to use these results in Mathematica. What I currently do is that I save the workspace as a ...
8
votes
1answer
490 views

Package functions and symbolic calculations

I'm writing my package (.m) in Mathematica and when I call the function it returns 0 instead of a right output. Here's my code: Package.m ...
8
votes
1answer
178 views

How to suppress automatically generated header in packages?

At the top of the .m file which is automatically generated from initialization cells in a notebook there appears a header: ...
8
votes
2answers
130 views

interpretation of <-> as UndirectedEdge in 11.2?

I have a package developed in earlier versions of Mathematica. In it, I use the notation x_ <-> y_ for undirected edges. When I use this package in 11.2, ...
8
votes
1answer
180 views

How to make your package check for update?

I am an author of a Mathematica application and I'd like to add a feature where it would check the web whether an update for the application is available. This update check should be done upon ...
8
votes
1answer
280 views

Loading Packages with Parameters

I have some packages that uses database connections inside it, let's call it ConnPackage. The connection IP is a public package variable, and has a default value: <...
8
votes
1answer
186 views

How to sort the functions in a Package?

Once a Package like abc` has been installed, we can use "?abc`*" to scan all the functions defined in this Package. Now I ...
8
votes
1answer
178 views

$InputFileName backwards compatibility

What would be a good replacement for $InputFileName (which has been added recently to Mathematica 8) to achieve backwards compatibility with let's say M6 and M7? I ...
8
votes
1answer
75 views

obtain properly formatted code from autogenerated package

Overview: I have written a few mathematica packages, always using the method of writing my code in a mathematica notebook and letting mathematica autogenerate the .m package file. Currently I do not ...
8
votes
1answer
190 views

How to export functions from a package without declaring them at the beginning of the package?

When making a package, I find it a bit difficult to remember to add functions as public, and update the ::usage tag. Is there some neat trick to automatically ...
8
votes
1answer
221 views

FindSelectedFunction for packages - how to make it work?

Fixed in 10.0. Works correctly since Mathematica 10.0. The Mathematica help menu contains an entry Find Selected Function (Cmd+Shift+F on OSX). If you are working with say ...
8
votes
2answers
257 views

Is Package development (via InitializationCells) compatible with creating new Notations (via MakeExpressions)?

Can new (lower-level) notations be readily used within package code? There are a few notational additions that might improve my code base but I'm not sure if these will end up being more trouble than ...
8
votes
1answer
186 views

Maeder's articles about Logic Programming with Mathematica

I found by chance Maeder's public articles about Logic Programming with Mathematica at the following links: Logic Programming I: The Interpreter and Logic Programming II: Applications . The first ...
8
votes
1answer
127 views

Memoization and packages

I am working in a package on symmetric functions, that sometimes are quite expensive to compute. I use memoization extensively, but what is the correct approach for a package intended for the public ...
8
votes
1answer
126 views

Maximum number of literal values for SetDelayed?

Under what circumstances should I expect Mathematica to turn a delayed assignment into an immediate assignment? I have put together a minimal example (available here) which demonstrates this behavior. ...
8
votes
0answers
53 views

Dealing with over eager shadowing messages

...
8
votes
0answers
423 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 ...
7
votes
1answer
557 views

3D rigid body physics engine

Is there a package in Mathematica that will allow me to simulate collisions of 3d rigid bodies? If not, what known libraries could I use and how? For example, one problem I want to simulate is a ...
7
votes
3answers
878 views

How to unload a Mathematica package?

I am using a publicly available Mathematica package on this page and is loaded in Mathematica by the command << EccentricIMR`; How do I unload this package? I don't want to use 'Quit' or '...
7
votes
2answers
562 views

How to obtain list of Installed Packages loadable by Get (<<)

When Get["MyPackage`"] is executed, Mathematica looks for a package in $UserBaseDirectory/Applications, and it does, it will ...
7
votes
2answers
3k views

FeynArts not working properly

So I have installed all FeynArts folders (from 3.5 to 3.7) with FeynCalc 8.0.1., and none of it is working properly :\ First I load the path to specific FeynArts package (3.5 for instance), then, by: ...
7
votes
1answer
396 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 ...
7
votes
1answer
358 views

Geometry computations add-on for Mathematica?

I came across the problem of calculating the circumcenters of triangles symbolically within another algorithm (as well as possibly doing other similar geometry computations). I was hoping Mathematica ...
7
votes
1answer
261 views

Extracting a mathematica package from a highly cited scientific work

I found a mathematica package that is particularly useful to me, published in (a highly cited work) a scientific journal. This package supposedly performs the ...
7
votes
2answers
695 views

Summa package problem

I need to use the features of the Summa package but it doesn't work in Mathematica 9. It gives the error Cannot open Utilities`FilterOptions` My question is: ...
7
votes
1answer
2k views

How to execute a function in the package from java?

I use Wolfram Workbench 2.0. I can get a KernelLink object and evaluate some simple expressions like "2+2". But I don't know how to export a package and execute ...
7
votes
1answer
134 views

How to (optionally) suppress package welcome message?

I'm working on a package and I want it to (usually) print a welcome message when it's loaded, primarily to leave a written trace of the version number in the notebook where it's used. For example: <...
7
votes
1answer
166 views

Fail to load a UTF8 package with one special Chinese character

Please check out the following code. BeginPackage["WTF`"] f::usage="blah" Begin["`Private`"] f[x_]:=1(*盘*); End[] EndPackage[] I've save the code to ...
7
votes
3answers
210 views

How can I pass replacement rules to a package-defined function and have it understand their context?

I am writing a package where I would like to be able to pass replacement rules to a function inside the package and have the function manipulate its symbols using those replacement rules. However, I'm ...
7
votes
1answer
359 views

Syntax Highlighting for WL files in Atom/Sublime?

What packages do people use for syntax highlighting in Atom, Sublime Text 3, etc?

1 2 3
4
5
15