Ion implantation for manufacturing bent and periodically bent crystals