3D compact photonic circuits for realizing quantum state tomography of qudits in any finite dimension