Programmable photonic quantum computing using qubits encoded in different degrees of freedom of a photon