Inverse design of relativistic lightsail for efficient propulsion