Few-qubit quantum hardware, algorithms and codes, on photonic and solid-state systems