Creating and deleting magnets with a laser