Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Jul 19, 2021
1 parent 95bc894 commit 3d5354d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/qutip_qip/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ def add_gate(self, gate, targets=None, controls=None, arg_value=None,

def add_gates(self, gates):
"""
Add a sequence of gates to the circuit.
Adds a sequence of gates to the circuit in a positive order, i.e.
the first gate in the sequence will be applied first to the state.
Parameters
----------
Expand Down Expand Up @@ -1498,11 +1499,16 @@ def _propagators_no_expand(self):
return U_list

def compute_unitary(self):
"""Evaluates all the gates in the quantum circuit of decomposed gates.
"""Evaluates the matrix of all the gates in a quantum circuit.
Returns
-------
circuit_unitary : :class:`qutip.Qobj`
Product of all gate arrays in the quantum circuit.
"""
gate_list = self.propagators()
unitary = gate_sequence_product(gate_list)
return unitary
circuit_unitary = gate_sequence_product(gate_list)
return circuit_unitary

def latex_code(self):
rows = []
Expand Down

0 comments on commit 3d5354d

Please sign in to comment.