An optical module comprising: a mirror unit having a movable mirror portion including a coil , the mirror unit comprising a support portion , a coupling portion coupling the movable mirror portion to the support portion , and a base to which the support portion is attached; a magnet portion having an upper surface , a bottom surface , and a side surface extending from the upper surface to the bottom surface , and configured to generate a magnetic field acting on the movable mirror portion ; wherein the magnet portion has a Halbach structure including a first magnet including a first area on the bottom surface and applied with a force in a first direction (D1) from the upper surface to the bottom surface , and a pair of second magnets , disposed with the first magnet interposed therebetween, including a second area on the upper surface and applied with a force in a second direction (D2) from the bottom surface to the upper surface , characterized in further comprising a package accommodating the magnet portion , wherein the package has a bottom wall portion configured to support the first area , a side wall portion supporting the side surface , and a restriction portion configured to restrict movement of the second magnets in the second direction (D2) by covering only a portion of the second area , and wherein the movable mirror portion is disposed in a space formed by the upper surface and the restriction portion . a mirror unit having a movable mirror portion including a coil , the mirror unit comprising a support portion , a coupling portion coupling the movable mirror portion to the support portion , and a base to which the support portion is attached; a magnet portion having an upper surface , a bottom surface , and a side surface extending from the upper surface to the bottom surface , and configured to generate a magnetic field acting on the movable mirror portion ; wherein the magnet portion has a Halbach structure including a first magnet including a first area on the bottom surface and applied with a force in a first direction (D1) from the upper surface to the bottom surface , and a pair of second magnets , disposed with the first magnet interposed therebetween, including a second area on the upper surface and applied with a force in a second direction (D2) from the bottom surface to the upper surface , characterized in further comprising a package accommodating the magnet portion , wherein the package has a bottom wall portion configured to support the first area , a side wall portion supporting the side surface , and a restriction portion configured to restrict movement of the second magnets in the second direction (D2) by covering only a portion of the second area , and wherein the movable mirror portion is disposed in a space formed by the upper surface and the restriction portion . a package accommodating the magnet portion , wherein the package has a bottom wall portion configured to support the first area , a side wall portion supporting the side surface , and a restriction portion configured to restrict movement of the second magnets in the second direction (D2) by covering only a portion of the second area , and wherein the movable mirror portion is disposed in a space formed by the upper surface and the restriction portion . <EOS>