From cd63dcb61fd93e42dc58ddd41f282b62561e3084 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 26 Feb 2025 13:05:43 -0500 Subject: [PATCH 1/3] Force LF style line endings in all text files As a repository we need to have consistent line endings so that we can resolve diffs sanely. Right now we haven't had an opinion on this. But some CRLF line endings caused major merge conflicts on #13278 and was preventing unraveling an otherwise simple merge conflict resolution. This commit sets a global default to use LF line endings for all text files to prevent such issues in the future. --- .gitattributes | 5 ++ .../0.23/fix-aqc-check-if-su-matrix.yaml | 8 +-- ...m-superposition-gate-3bd95ffdf05ef18c.yaml | 54 +++++++++---------- 3 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..3539978ebc4f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Default all text files to use LF line endings +* text eol=lf + +# Mark PNG files as binary so git doesn't try to mess with the line endings +*.png binary diff --git a/releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml b/releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml index 6f5a27072380..654728017279 100644 --- a/releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml +++ b/releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml @@ -1,5 +1,5 @@ -fixes: - - | - Fixed an issue with the approximate quantum compiler (:class:`~qiskit.transpiler.synthesis.aqc.AQC`) that caused - it to return a wrong circuit when the unitary has a determinant −1. +fixes: + - | + Fixed an issue with the approximate quantum compiler (:class:`~qiskit.transpiler.synthesis.aqc.AQC`) that caused + it to return a wrong circuit when the unitary has a determinant −1. \ No newline at end of file diff --git a/releasenotes/notes/1.3/uniform-superposition-gate-3bd95ffdf05ef18c.yaml b/releasenotes/notes/1.3/uniform-superposition-gate-3bd95ffdf05ef18c.yaml index 6017979748ea..8bd6fcf3b1b3 100644 --- a/releasenotes/notes/1.3/uniform-superposition-gate-3bd95ffdf05ef18c.yaml +++ b/releasenotes/notes/1.3/uniform-superposition-gate-3bd95ffdf05ef18c.yaml @@ -1,27 +1,27 @@ ---- -features: - - | - Implemented :class:`.UniformSuperpositionGate` class, which allows - the creation of a uniform superposition state using - the Shukla-Vedula algorithm. This feature facilitates the - creation of quantum circuits that produce a uniform superposition - state :math:`\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} |j\rangle`, where - :math:`M` is a positive integer representing the number of - computational basis states with an amplitude of - :math:`\frac{1}{\sqrt{M}}`. This implementation supports the - efficient creation of uniform superposition states, - requiring only :math:`O(\log_2 (M))` qubits and - :math:`O(\log_2 (M))` gates. Usage example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.circuit.library.data_preparation import UniformSuperpositionGate - - M = 5 - num_qubits = 3 - usp_gate = UniformSuperpositionGate(M, num_qubits) - qc = QuantumCircuit(num_qubits) - qc.append(usp_gate, list(range(num_qubits))) - - qc.draw() +--- +features: + - | + Implemented :class:`.UniformSuperpositionGate` class, which allows + the creation of a uniform superposition state using + the Shukla-Vedula algorithm. This feature facilitates the + creation of quantum circuits that produce a uniform superposition + state :math:`\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} |j\rangle`, where + :math:`M` is a positive integer representing the number of + computational basis states with an amplitude of + :math:`\frac{1}{\sqrt{M}}`. This implementation supports the + efficient creation of uniform superposition states, + requiring only :math:`O(\log_2 (M))` qubits and + :math:`O(\log_2 (M))` gates. Usage example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.circuit.library.data_preparation import UniformSuperpositionGate + + M = 5 + num_qubits = 3 + usp_gate = UniformSuperpositionGate(M, num_qubits) + qc = QuantumCircuit(num_qubits) + qc.append(usp_gate, list(range(num_qubits))) + + qc.draw() From 175e075de05044016c09b113d7daee5e4bb32b9b Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 27 Feb 2025 09:07:25 -0500 Subject: [PATCH 2/3] Try overriding the setting for visual comparison tests --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 3539978ebc4f..2102e229c8d2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ # Default all text files to use LF line endings * text eol=lf +visualization/references/*.{txt,tex} text=auto # Mark PNG files as binary so git doesn't try to mess with the line endings *.png binary From d65c3e9ca624dd7c03d1f92fe1eb5cfc62e2fad8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 27 Feb 2025 20:04:09 -0500 Subject: [PATCH 3/3] Fix typo --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2102e229c8d2..785d14f8cd8b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ # Default all text files to use LF line endings * text eol=lf -visualization/references/*.{txt,tex} text=auto +visualization/references/*.{txt,tex} text eol=auto # Mark PNG files as binary so git doesn't try to mess with the line endings *.png binary