Logical-qubit operations in an error-detecting surface code