A method for operating a linear drive system, wherein the linear drive system comprises a primary part and a secondary part, which may be moved in a translatory manner relative to each other, wherein the primary part comprises an electromagnet device which may be energized, and the secondary part comprises a magnet arrangement of permanent magnets arranged next to each other, wherein by energizing the electromagnet device of the primary part a magnetic interaction between the electromagnet device and the magnet arrangement of the secondary part may be caused to move the primary part and the secondary part relative to each other, wherein the primary part comprises a sensor device of magnetic field sensors for detecting a magnetic field generated by the magnet arrangement of the secondary part, wherein, in an initial measurement, the magnetic field of the magnet arrangement of the secondary part is detected with the aid of the sensor device at different positions of the primary part with respect to the secondary part and position-dependent reference magnetic field data are provided, wherein a position determination for the primary part is carried out, in that the magnetic field of the magnet arrangement of the secondary part is detected with the aid of the sensor device at a current position of the primary part with respect to the secondary part and current magnetic field data are provided, and based on the reference magnetic field data and the current magnetic field data, the current position of the primary part with respect to the secondary part is determined, wherein the position determination comprises carrying out a comparison of at least a part of the current magnetic field data with parts of the reference magnetic field data using a similarity method, characterized in that the position determination is based on dividing up the permanent magnets of the magnet arrangement of the secondary part into a plurality of magnet groups of permanent magnets arranged next to each other, and the reference magnetic field data comprises a plurality of magnetic field patterns, each of which being associated with a magnet group of permanent magnets arranged next to each other of the magnet arrangement of the secondary part. wherein the primary part comprises an electromagnet device which may be energized, and the secondary part comprises a magnet arrangement of permanent magnets arranged next to each other, wherein by energizing the electromagnet device of the primary part a magnetic interaction between the electromagnet device and the magnet arrangement of the secondary part may be caused to move the primary part and the secondary part relative to each other, wherein the primary part comprises a sensor device of magnetic field sensors for detecting a magnetic field generated by the magnet arrangement of the secondary part, wherein, in an initial measurement, the magnetic field of the magnet arrangement of the secondary part is detected with the aid of the sensor device at different positions of the primary part with respect to the secondary part and position-dependent reference magnetic field data are provided, wherein a position determination for the primary part is carried out, in that the magnetic field of the magnet arrangement of the secondary part is detected with the aid of the sensor device at a current position of the primary part with respect to the secondary part and current magnetic field data are provided, and based on the reference magnetic field data and the current magnetic field data, the current position of the primary part with respect to the secondary part is determined, wherein the position determination comprises carrying out a comparison of at least a part of the current magnetic field data with parts of the reference magnetic field data using a similarity method, characterized in that the position determination is based on dividing up the permanent magnets of the magnet arrangement of the secondary part into a plurality of magnet groups of permanent magnets arranged next to each other, and the reference magnetic field data comprises a plurality of magnetic field patterns, each of which being associated with a magnet group of permanent magnets arranged next to each other of the magnet arrangement of the secondary part.