-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to user config to control reverse_bits in circuit drawer (#…
…9211) * add reverse_bits option to user_config * check in circuit_visualization if circuit_reverse_bits option in present user configuration * in quantumcircuit.py, change default value of reverse_bits to None * reno * update docstrings * add tests to test_user_config.py, and run testing * reno update * Add conditional to set `default_reverse_bits` to value in user config file only if `wire_order` option is not passed to drawer This avoids confusion when user tries to pass `wire_order` to the drawer, but reverse_bits has been set to `True` in the user config file, which will then throw an error. This means that the `wire_order` option passed to the drawer takes precedence over the `reverse_bits` option set in the user config file. * Add test of loading default-override from config * Reword release note Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5ef95e6
commit 954ce14
Showing
6 changed files
with
122 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
releasenotes/notes/add-reverse-bits-to-user-config-options-0e465e6e92d5b49f.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
features: | ||
- | | ||
The user configuration file has a new option ``circuit_reverse_bits``, which takes a Boolean | ||
value. This allows users to set their preferred default behavior of the ``reverse_bits`` option | ||
of the circuit drawers :meth:`.QuantumCircuit.draw` and :func:`.circuit_drawer`. For example, | ||
adding a section to ``~/.qiskit/settings.conf`` with: | ||
.. code-block:: text | ||
[default] | ||
circuit_reverse_bits = True | ||
will change the default to display the bits in reverse order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters