Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Add documentation for the user config file #216

Merged
merged 1 commit into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/terra/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Qiskit Terra Documentation
Plotting Data in Qiskit <plotting_data_in_qiskit>
Tools for Monitoring Backends <backend_monitoring_tools>
Terra Parallel Tools <terra_parallel_tools>
Using User Config Files <user_config>
39 changes: 39 additions & 0 deletions docs/terra/user_config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
User Config Files
=================

When using Qiskit Terra there are several aspects of the library where Terra
has opinionated defaults. These defaults are normally in the interest of
supporting the least common demonitator between users. For example, the default
backend for ``qiskit.visualization.circuit_drawer()``/``QuantumCircuit.draw()``
is the text backend. However, depending on your local environment you may want
to change these defaults to something better suited for your use case. This is
what the user config file can be used for. It lets you optionally specify
local defaults for these things


Creating a User Config File
---------------------------

By default the user config file should be located in
``~/.qiskit/settings.conf``. It is a ``.ini`` file that lists any options you'd
like to change the defaults on. Right now there is only one supported option,
``circuit_drawer`` which is used to set the default backend used when running
the circuit drawer.

For example, a ``settings.conf`` file with all the options set would look
like::

[default]
circuit_drawer = latex

In this file when you call the circuit drawer the default output will be
``'latex'`` instead of ``'text'``.

Alternative Locations for a User Config File
--------------------------------------------

The default location for the user config file is ``~/.qiskit/settings.conf``
but if you want to store your user config file in a different location you
can specify this with the ``QISKIT_SETTINGS`` environment variable. When
``QISKIT_SETTINGS`` is set Qiskit Terra will try to use the value as the path
to the user config file.