What are the ways to modify the form of magnetic field from the permanent magnet? For example I have a permanent neodymium magnet. Its magnetic field is distributed at large volume around the magnet, with decreasing strength at larger distances from the magnet. I'd like to make it concentrated in very small distances around this magnet, and to have no field or largely less strong field beyond some given distance from the magnet. Is it possible at all, and if yes, how?
To modify the distribution of magnetic field (irrespectively of the source - PMs or coils), you need some material with non-unit magnetic permeability, such as steel. These materials 'concentrate' the field lines, pulling them in away from the surrounding air (which has a permeability of very nearly 1). So to shield the outside world, you'd need to create a 'circuit' of permeable material (let's say steel), which channels the magnetic flux from the north pole of your magnet to its south pole. If you leave a little gap in one part of your circuit, the field will be enhanced in the gap.
You can place individual magnets into certain array configurations that will augment their magnetic fields. You may look up the Halbach Array for an example of how magnetic fields can be arranged to concentrate the flux in one area while cancelling it out in another. Also, magnetic fields are a great deal like a flexible rubber coating around the periphery of the magnet; repelling fields can be compressed, causing them to elongate and protrude outwards like jelly being squished out the sides of a sandwich when you squeeze down on it. You can think of the magnets as the slices of bread, and the jelly as the way in which the magnetic field behaves when compressed. There are some cool applications for these type of magnet arrays; maybe you'll find one of these helpful.