<commit_before>.. _bqm:

=======================================
Ising, QUBO and Binary Quadratic Models
=======================================

Overview
========
.. automodule:: dimod.binary_quadratic_model

.. currentmodule:: dimod
.. autoclass:: BinaryQuadraticModel


Vartype Properties
==================

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.binary
   BinaryQuadraticModel.spin

Methods
=======

Adding and removing variables and interactions
----------------------------------------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.add_variable
   BinaryQuadraticModel.add_variables_from
   BinaryQuadraticModel.add_interaction
   BinaryQuadraticModel.add_interactions_from
   BinaryQuadraticModel.add_offset
   BinaryQuadraticModel.remove_variable
   BinaryQuadraticModel.remove_variables_from
   BinaryQuadraticModel.remove_interaction
   BinaryQuadraticModel.remove_interactions_from
   BinaryQuadraticModel.remove_offset
   BinaryQuadraticModel.update

Transformations
---------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.contract_variables
   BinaryQuadraticModel.fix_variable
   BinaryQuadraticModel.flip_variable
   BinaryQuadraticModel.relabel_variables
   BinaryQuadraticModel.scale

Change Vartype
--------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.change_vartype

Copy
----

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.copy

Energy
------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.energy

Conversion Functions
====================

.. currentmodule:: dimod

.. autosummary::
   :toctree: generated/

   from_ising
   from_numpy_matrix
   from_qubo
   from_pandas_dataframe
   to_ising
   to_networkx_graph
   to_numpy_matrix
   to_qubo
   to_pandas_dataframe<commit_msg>Update BQM docs for conversion methods<commit_after>.. _bqm:

=======================================
Ising, QUBO and Binary Quadratic Models
=======================================

Overview
========
.. automodule:: dimod.binary_quadratic_model

.. currentmodule:: dimod
.. autoclass:: BinaryQuadraticModel


Vartype Properties
==================

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.binary
   BinaryQuadraticModel.spin

Methods
=======

Adding and removing variables and interactions
----------------------------------------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.add_variable
   BinaryQuadraticModel.add_variables_from
   BinaryQuadraticModel.add_interaction
   BinaryQuadraticModel.add_interactions_from
   BinaryQuadraticModel.add_offset
   BinaryQuadraticModel.remove_variable
   BinaryQuadraticModel.remove_variables_from
   BinaryQuadraticModel.remove_interaction
   BinaryQuadraticModel.remove_interactions_from
   BinaryQuadraticModel.remove_offset
   BinaryQuadraticModel.update

Transformations
---------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.contract_variables
   BinaryQuadraticModel.fix_variable
   BinaryQuadraticModel.flip_variable
   BinaryQuadraticModel.relabel_variables
   BinaryQuadraticModel.scale

Change Vartype
--------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.change_vartype

Copy
----

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.copy

Energy
------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.energy

Converting to other types
-------------------------

.. autosummary::
   :toctree: generated/

   BinaryQuadraticModel.from_ising
   BinaryQuadraticModel.from_numpy_matrix
   BinaryQuadraticModel.from_qubo
   BinaryQuadraticModel.from_pandas_dataframe
   BinaryQuadraticModel.to_ising
   BinaryQuadraticModel.to_networkx_graph
   BinaryQuadraticModel.to_numpy_matrix
   BinaryQuadraticModel.to_qubo
   BinaryQuadraticModel.to_pandas_dataframe
{'fraction_non_alphanumeric': 0.1616213442791175, 'fraction_numerical': 0.0, 'mean_word_length': 3.8859649122807016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2545461', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1159, 'n_words': 172}