When using arrays I generally use only a one or two dimensional array -- very rarely three or more. I'm just kind of curious, what are some interesting/practical uses for arrays with three or more dimensions? Have you ever used an array with four or more dimensions? I had a professor in college use a six dimensional array in a program he demonstrated in class...ever had more than this?
In scientific programming it can be quite common. We just start calling these higher dimensional arrays tensors. Scalars are 0-dimensional tensors, vectors are 1-dimensional tensors, matrices are 2-dimensional tensors, and after that we just call them d-dimensional tensors (d=3,4,5,6). Dot products are then called contractions over indices.
Where are they used? I use them in some of my physics simulations. For instance, one method for simulating electrons on a lattice (regular array of sites) uses a tensor with a different set of indices for each connection to a neighboring site. In a 2D square lattice (think sites in the center of each space on a chess board), that means that each tensor has four indices, one for each neighboring site, so it is a 4-dimensional tensor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With