Light-based quantum circuit does basic maths