internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: Qiskit/qiskit

Issue:
Don't plot pulse table by default
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->

### What is the expected enhancement?
Currently when plotting a plot schedule with `Schedule.draw` the option `table` is true by default. This should be switched to false.




Discussion:

Resolving patch:
diff --git a/qiskit/pulse/schedule.py b/qiskit/pulse/schedule.py
--- a/qiskit/pulse/schedule.py
+++ b/qiskit/pulse/schedule.py
@@ -522,7 +522,7 @@ def draw(self, dt: float = 1, style=None,
              scale: Optional[float] = None,
              channel_scales: Optional[Dict[Channel, float]] = None,
              plot_all: bool = False, plot_range: Optional[Tuple[float]] = None,
-             interactive: bool = False, table: bool = True, label: bool = False,
+             interactive: bool = False, table: bool = False, label: bool = False,
              framechange: bool = True, scaling: float = None,
              channels: Optional[List[Channel]] = None,
              show_framechange_channels: bool = True):
diff --git a/qiskit/visualization/pulse/matplotlib.py b/qiskit/visualization/pulse/matplotlib.py
--- a/qiskit/visualization/pulse/matplotlib.py
+++ b/qiskit/visualization/pulse/matplotlib.py
@@ -783,7 +783,7 @@ def draw(self, schedule: ScheduleComponent,
              plot_range: Tuple[Union[int, float], Union[int, float]],
              scale: float = None,
              channel_scales: Dict[Channel, float] = None,
-             plot_all: bool = True, table: bool = True,
+             plot_all: bool = True, table: bool = False,
              label: bool = False, framechange: bool = True,
              scaling: float = None, channels: List[Channel] = None,
              show_framechange_channels: bool = True):
diff --git a/qiskit/visualization/pulse_visualization.py b/qiskit/visualization/pulse_visualization.py
--- a/qiskit/visualization/pulse_visualization.py
+++ b/qiskit/visualization/pulse_visualization.py
@@ -43,7 +43,7 @@ def pulse_drawer(data: Union[Waveform, ScheduleComponent],
                  plot_all: bool = False,
                  plot_range: Tuple[Union[int, float], Union[int, float]] = None,
                  interactive: bool = False,
-                 table: bool = True,
+                 table: bool = False,
                  label: bool = False,
                  framechange: bool = True,
                  channels: List[Channel] = None,


Test patch:
Repository: Qiskit/qiskit

Issue:
Terra Tests Fail with Numpy 1.19.0
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: Master
- **Python version**: Any
- **Operating system**: Any

### What is the current behavior?

Since the release of numpy 1.19.0 CI started failing on 2 tests:
`test_qasm_2q_unitary`
https://github.com/Qiskit/qiskit-terra/blob/master/test/python/circuit/test_unitary.py#L248-L271
and
`test_pulse_limits:
https://github.com/Qiskit/qiskit-terra/blob/master/test/python/pulse/test_pulse_lib.py#L60-L89

It's not clear if this is a bug in numpy or a usage bug in terra. If it's an iss

This is being pinned in CI with https://github.com/Qiskit/qiskit-terra/pull/4599

### Steps to reproduce the problem

Run the tests with numpy 1.19.0

### What is the expected behavior?

The tests pass

### Suggested solutions

Find the source of the bug, and fix or report it upstream



Discussion:
The pulse side of the failures should be fixed with: https://github.com/Qiskit/qiskit-terra/pull/4613

Resolving patch:
diff --git a/qiskit/quantum_info/synthesis/two_qubit_decompose.py b/qiskit/quantum_info/synthesis/two_qubit_decompose.py
--- a/qiskit/quantum_info/synthesis/two_qubit_decompose.py
+++ b/qiskit/quantum_info/synthesis/two_qubit_decompose.py
@@ -377,7 +377,7 @@ def decomp0(target):
         U0l = target.K1l.dot(target.K2l)
         U0r = target.K1r.dot(target.K2r)
 
-        return U0r, U0l
+        return np.around(U0r, 13), np.around(U0l, 13)
 
     def decomp1(self, target):
         """Decompose target ~Ud(x, y, z) with 1 uses of the basis gate ~Ud(a, b, c).


Test patch:
Repository: Qiskit/qiskit

Issue:
Operator() cannot simualte circuits with barrier
it should, as they are just compiler directives.


Discussion:
You can fix this they same way its handled in `Statevector.from_instruction`

Resolving patch:
diff --git a/qiskit/quantum_info/operators/channel/superop.py b/qiskit/quantum_info/operators/channel/superop.py
--- a/qiskit/quantum_info/operators/channel/superop.py
+++ b/qiskit/quantum_info/operators/channel/superop.py
@@ -378,12 +378,16 @@ def _instruction_to_superop(cls, obj):
 
     def _append_instruction(self, obj, qargs=None):
         """Update the current Operator by apply an instruction."""
+        from qiskit.circuit.barrier import Barrier
+
         chan = self._instruction_to_superop(obj)
         if chan is not None:
             # Perform the composition and inplace update the current state
             # of the operator
             op = self.compose(chan, qargs=qargs)
             self._data = op.data
+        elif isinstance(obj, Barrier):
+            return
         else:
             # If the instruction doesn't have a matrix defined we use its
             # circuit decomposition definition if it exists, otherwise we
diff --git a/qiskit/quantum_info/operators/operator.py b/qiskit/quantum_info/operators/operator.py
--- a/qiskit/quantum_info/operators/operator.py
+++ b/qiskit/quantum_info/operators/operator.py
@@ -510,12 +510,16 @@ def _instruction_to_matrix(cls, obj):
 
     def _append_instruction(self, obj, qargs=None):
         """Update the current Operator by apply an instruction."""
+        from qiskit.circuit.barrier import Barrier
+
         mat = self._instruction_to_matrix(obj)
         if mat is not None:
             # Perform the composition and inplace update the current state
             # of the operator
             op = self.compose(mat, qargs=qargs)
             self._data = op.data
+        elif isinstance(obj, Barrier):
+            return
         else:
             # If the instruction doesn't have a matrix defined we use its
             # circuit decomposition definition if it exists, otherwise we
diff --git a/qiskit/quantum_info/operators/symplectic/clifford_circuits.py b/qiskit/quantum_info/operators/symplectic/clifford_circuits.py
--- a/qiskit/quantum_info/operators/symplectic/clifford_circuits.py
+++ b/qiskit/quantum_info/operators/symplectic/clifford_circuits.py
@@ -18,6 +18,7 @@
 
 from qiskit.exceptions import QiskitError
 from qiskit.circuit import QuantumCircuit
+from qiskit.circuit.barrier import Barrier
 
 
 def _append_circuit(clifford, circuit, qargs=None):
@@ -34,6 +35,9 @@ def _append_circuit(clifford, circuit, qargs=None):
     Raises:
         QiskitError: if input gate cannot be decomposed into Clifford gates.
     """
+    if isinstance(circuit, Barrier):
+        return clifford
+
     if qargs is None:
         qargs = list(range(clifford.num_qubits))
 


Test patch:
Repository: Qiskit/qiskit

Issue:
Plotting bloch sphere using spherical coordinates
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->

### What is the expected enhancement?

Functionality to accept Spherical coordinates as well as typical Cartesian for plot_bloch_vector function under state_visualization.py 
(https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/visualization/state_visualization.py)



Discussion:

Resolving patch:
diff --git a/qiskit/visualization/state_visualization.py b/qiskit/visualization/state_visualization.py
--- a/qiskit/visualization/state_visualization.py
+++ b/qiskit/visualization/state_visualization.py
@@ -184,17 +184,22 @@ def plot_state_hinton(state, title='', figsize=None, ax_real=None, ax_imag=None,
         return fig
 
 
-def plot_bloch_vector(bloch, title="", ax=None, figsize=None):
+def plot_bloch_vector(bloch, title="", ax=None, figsize=None, coord_type="cartesian"):
     """Plot the Bloch sphere.
 
     Plot a sphere, axes, the Bloch vector, and its projections onto each axis.
 
     Args:
-        bloch (list[double]): array of three elements where [<x>, <y>, <z>]
+        bloch (list[double]): array of three elements where [<x>, <y>, <z>] (cartesian)
+            or [<r>, <theta>, <phi>] (spherical in radians)
+            <theta> is inclination angle from +z direction
+            <phi> is azimuth from +x direction
         title (str): a string that represents the plot title
         ax (matplotlib.axes.Axes): An Axes to use for rendering the bloch
             sphere
         figsize (tuple): Figure size in inches. Has no effect is passing ``ax``.
+        coord_type (str): a string that specifies coordinate type for bloch
+            (cartesian or spherical), default is cartesian
 
     Returns:
         Figure: A matplotlib figure instance if ``ax = None``.
@@ -216,6 +221,11 @@ def plot_bloch_vector(bloch, title="", ax=None, figsize=None):
     if figsize is None:
         figsize = (5, 5)
     B = Bloch(axes=ax)
+    if coord_type == "spherical":
+        r, theta, phi = bloch[0], bloch[1], bloch[2]
+        bloch[0] = r*np.sin(theta)*np.cos(phi)
+        bloch[1] = r*np.sin(theta)*np.sin(phi)
+        bloch[2] = r*np.cos(theta)
     B.add_vectors(bloch)
     B.render(title=title)
     if ax is None:


Test patch:
Repository: Qiskit/qiskit

Issue:
Documentation mistake
## Does existing documentation need to be updated with new content?
Yes
- Which files need to be updated?
https://qiskit.org/documentation/stubs/qiskit.circuit.library.U3Gate.html

- What content needs to be updated or replaced? (You can copy and paste)
Assuming the given form of U3 is correct, we can clearly see it will NOT factorise to U3(\theta, \phi, \lambda) = RZ(\phi - \pi/2) RX(\pi/2) RZ(\pi - \theta) RX(\pi/2) RZ(\lambda - \pi/2) as claimed. We can easily see this by taking eg (\phi, \lambda) = (-\pi/2,\pi/2) and expanding this expression and noting it does not yield RX(\theta)$as claimed (and can easily be shown to be true). 

- What new content needs to be added?
One possible correct answer is RZ(\phi) RX(\pi/2)RZ(\pi - \theta) RX(\pi/2)RZ(\lambda+\pi).

Issue originally opened in Qiskit/qiskit but I suspect this is the correct place for it now?


Discussion:

Resolving patch:
diff --git a/qiskit/circuit/library/standard_gates/u2.py b/qiskit/circuit/library/standard_gates/u2.py
--- a/qiskit/circuit/library/standard_gates/u2.py
+++ b/qiskit/circuit/library/standard_gates/u2.py
@@ -26,7 +26,7 @@ class U2Gate(Gate):
     Implemented using one X90 pulse on IBM Quantum systems:
 
     .. math::
-        U2(\phi, \lambda) = RZ(\phi+\pi/2).RX(\frac{\pi}{2}).RZ(\lambda-\pi/2)
+        U2(\phi, \lambda) = RZ(\phi).RY(\frac{\pi}{2}).RZ(\lambda)
 
     **Circuit symbol:**
 
@@ -51,7 +51,8 @@ class U2Gate(Gate):
     .. math::
 
         U2(0, \pi) = H
-
+        U2(0, 0) = RY(\pi/2)
+        U2(-\pi/2, \pi/2) = RX(\pi/2)
     .. seealso::
 
         :class:`~qiskit.circuit.library.standard_gates.U3Gate`:
diff --git a/qiskit/circuit/library/standard_gates/u3.py b/qiskit/circuit/library/standard_gates/u3.py
--- a/qiskit/circuit/library/standard_gates/u3.py
+++ b/qiskit/circuit/library/standard_gates/u3.py
@@ -27,7 +27,7 @@ class U3Gate(Gate):
 
     .. math::
         U3(\theta, \phi, \lambda) =
-            RZ(\phi - \pi/2) RX(\pi/2) RZ(\pi - \theta) RX(\pi/2) RZ(\lambda - \pi/2)
+            RZ(\phi) RX(-\pi/2) RZ(\theta) RX(\pi/2) RZ(\lambda)
 
     **Circuit symbol:**
 


Test patch:
Repository: Qiskit/qiskit

Issue:
Executing a schedule with one instruction raises an error
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**:
- **Python version**:
- **Operating system**:

### What is the current behavior?

If I make a schedule with only one instruction:
```
sched = pulse.Acquire(20, pulse.AcquireChannel(0), pulse.MemorySlot(0))
```
then when I `execute` it, it's type is `Instruction` and not `Schedule`, so `execute` wrongly sends it through the `transpiler`, thinking it's a `QuantumCircuit`. Since the transpiler is expecting a circuit, we end up with an attribute error as it tries to access `circuit.qubits`, which isn't a Schedule property.


### Steps to reproduce the problem



### What is the expected behavior?



### Suggested solutions

The easiest fix is to replace `isinstance(experiments, Schedule)` with `isinstance(experiments, (Schedule, pulse.Instruction)`, or perhaps more correctly: `isinstance(experiments, ScheduleComponent)`. Would have to add tests and make sure there aren't other consequences of taking an `Instruction` as input. 



Discussion:
This *is* just an instruction though. Should we allow executing a sole instruction?
Yes. I don't think it's very high priority though

Resolving patch:
diff --git a/qiskit/assembler/assemble_schedules.py b/qiskit/assembler/assemble_schedules.py
--- a/qiskit/assembler/assemble_schedules.py
+++ b/qiskit/assembler/assemble_schedules.py
@@ -93,6 +93,10 @@ def _assemble_experiments(
                                     converters.InstructionToQobjConverter)
     instruction_converter = instruction_converter(qobj.PulseQobjInstruction,
                                                   **run_config.to_dict())
+
+    schedules = [
+        sched if isinstance(sched, pulse.Schedule) else pulse.Schedule(sched) for sched in schedules
+    ]
     compressed_schedules = transforms.compress_pulses(schedules)
 
     user_pulselib = {}


Test patch:
diff --git a/test/python/compiler/test_assembler.py b/test/python/compiler/test_assembler.py
--- a/test/python/compiler/test_assembler.py
+++ b/test/python/compiler/test_assembler.py
@@ -915,6 +915,12 @@ def test_assemble_with_unequal_kernels(self):
                      meas_lo_freq=self.default_meas_lo_freq,
                      meas_map=[[0, 1, 2]])
 
+    def test_assemble_single_instruction(self):
+        """Test assembling schedules, no lo config."""
+        inst = pulse.Play(pulse.Constant(100, 1.0), pulse.DriveChannel(0))
+        qobj = assemble(inst, self.backend)
+        validate_qobj_against_schema(qobj)
+
 
 class TestPulseAssemblerMissingKwargs(QiskitTestCase):
     """Verify that errors are raised in case backend is not provided and kwargs are missing."""
Repository: Qiskit/qiskit

Issue:
Documentation minor mistake
https://github.com/Qiskit/qiskit-terra/blob/8636502a832ee5c63a26f66c9669c88a1149e432/qiskit/qobj/pulse_qobj.py#L601

Probably won't matter too much, but just to state everything correctly. The PulseQobj.to_dict() should return a dictionary that describes the PulseQobj instead of QasmQobj, right?


Discussion:

Resolving patch:
diff --git a/qiskit/qobj/pulse_qobj.py b/qiskit/qobj/pulse_qobj.py
--- a/qiskit/qobj/pulse_qobj.py
+++ b/qiskit/qobj/pulse_qobj.py
@@ -596,7 +596,7 @@ def default(self, obj):
                 against the jsonschema for qobj spec.
 
         Returns:
-            dict: A dictionary representation of the QasmQobj object
+            dict: A dictionary representation of the PulseQobj object
         """
         out_dict = {
             'qobj_id': self.qobj_id,


Test patch:
Repository: Qiskit/qiskit

Issue:
Clarify type for "channels" argument in Schedule.draw()
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: 15.1

### What is the current behavior?
<img width="573" alt="image" src="https://user-images.githubusercontent.com/60495383/90835970-f2baf580-e302-11ea-9486-4baa0deee309.png">

In the docstring for Schedule.draw(), the description for the "channels" kwarg reads "A list of channel names to plot" suggesting the argument should be a list of strings (maybe obtained via Channel.name), but the indicated type (red text in image) is a list of Channel objects. Which is it? Or are both supported?

### Suggested solutions

Figure out what types are accepted by this function. If it's a list of strings, update the type indicated in the docs to be Optional[List[str]]. If it's a list of Channels, update the text to read "A list of Channels to plot". If both types are supported, update the text to read "A list of Channels to plot", and the type accordingly.



Discussion:

Resolving patch:
diff --git a/qiskit/pulse/schedule.py b/qiskit/pulse/schedule.py
--- a/qiskit/pulse/schedule.py
+++ b/qiskit/pulse/schedule.py
@@ -650,7 +650,7 @@ def draw(self, dt: float = 1, style=None,
             table: Draw event table for supported commands.
             label: Label individual instructions.
             framechange: Add framechange indicators.
-            channels: A list of channel names to plot.
+            channels: A list of Channels to plot.
             show_framechange_channels: Plot channels with only framechanges.
 
         Additional Information:


Test patch:
Repository: Qiskit/qiskit

Issue:
Bug in text format of SabreSwap 
What is the file name(s) where you found the bug? 
File name: SabreSwap
https://qiskit.org/documentation/apidoc/transpiler_passes.html#module-qiskit.transpiler.passes

What is the current text that needs to be fixed? 
The mathematical expression for H_decay is overflown and out of the webpage margins. The absolute sign is missing?



The link for 'SabreSwap()' 
https://qiskit.org/documentation/stubs/qiskit.transpiler.passes.SabreSwap.html#sabreswap

Are there other related issues or pull requests about this bug?
No.
Does existing documentation need to be updated with new content? No
Which files need to be updated? No

![Screen Shot 2020-08-14 at 7 34 06 PM](https://user-images.githubusercontent.com/69056626/90299710-26aa9c80-de65-11ea-8da2-4df716ea60c3.png)



Discussion:
It can be fixed by updating the rst file for this class. I can work on it if need be.
@deeplokhande That's great! You can go ahead and update it
Assigning @deeplokhande to this issue.
Hey! I am new here and would like to contribute. Is the problem still open?
@deeplokhande are you working on this issue? Please response asap. 
Reassigning to @tgag17, since @deeplokhande is not responsive.

Let us know if you are in @tgag17 !
Thanks!


Resolving patch:
diff --git a/qiskit/transpiler/passes/routing/sabre_swap.py b/qiskit/transpiler/passes/routing/sabre_swap.py
--- a/qiskit/transpiler/passes/routing/sabre_swap.py
+++ b/qiskit/transpiler/passes/routing/sabre_swap.py
@@ -101,8 +101,8 @@ def __init__(self, coupling_map, heuristic='basic', seed=None):
 
             .. math::
 
-                H_{decay} = \frac{1}{\abs{F}} \sum_{gate \in F} D[\pi(gate.q_1)][\pi(gate.q2)]
-                    + W * \frac{1}{\abs{E}} \sum_{gate \in E} D[\pi(gate.q_1)][\pi(gate.q2)]
+                H_{decay}=\frac{1}{\left|{F}\right|}\sum_{gate \in F} D[\pi(gate.q_1)][\pi(gate.q2)]
+                    + W*\frac{1}{\left|{E}\right|} \sum_{gate \in E} D[\pi(gate.q_1)][\pi(gate.q2)]
 
             - 'decay':
 
@@ -113,8 +113,8 @@ def __init__(self, coupling_map, heuristic='basic', seed=None):
             .. math::
 
                 H_{decay} = max(decay(SWAP.q_1), decay(SWAP.q_2)) {
-                    \frac{1}{\abs{F}} \sum_{gate \in F} D[\pi(gate.q_1)][\pi(gate.q2)]
-                    + W * \frac{1}{\abs{E}} \sum_{gate \in E} D[\pi(gate.q_1)][\pi(gate.q2)]
+                    \frac{1}{\left|{F}\right|} \sum_{gate \in F} D[\pi(gate.q_1)][\pi(gate.q2)]\\
+                    + W *\frac{1}{\left|{E}\right|} \sum_{gate \in E} D[\pi(gate.q_1)][\pi(gate.q2)]
                     }
         """
 


Test patch:
Repository: Qiskit/qiskit

Issue:
QuantumCircuit __eq__ fails when comparing with None
## Information
Qiskit Terra version: 0.15.1
Python version: 3.7.7
Operating system: MacOS v10.15.6

## What is the current behavior?
When two `QuantumCircuit` objects are compared with `==` and one of them is `None`, an error is thrown.

## Steps to reproduce the problem
```
from qiskit import QuantumCircuit
qc1 = QuantumCircuit()
qc2 = None
qc1 == qc2 --> error
```

## What is the expected behavior?
The `qc1 == qc2` comparison should always return `True` or `False`.


Discussion:
Probably `False` is the right behaviour here 👍  Do you want to fix this? 
> Probably `False` is the right behaviour here 👍 Do you want to fix this?

Yep, I am creating a PR right now.

Resolving patch:
diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py
--- a/qiskit/circuit/quantumcircuit.py
+++ b/qiskit/circuit/quantumcircuit.py
@@ -220,6 +220,9 @@ def __str__(self):
         return str(self.draw(output='text'))
 
     def __eq__(self, other):
+        if not isinstance(other, QuantumCircuit):
+            return False
+
         # TODO: remove the DAG from this function
         from qiskit.converters import circuit_to_dag
         return circuit_to_dag(self) == circuit_to_dag(other)


Test patch:
diff --git a/test/python/circuit/test_circuit_operations.py b/test/python/circuit/test_circuit_operations.py
--- a/test/python/circuit/test_circuit_operations.py
+++ b/test/python/circuit/test_circuit_operations.py
@@ -587,6 +587,38 @@ def test_inverse(self):
         expected.global_phase = -0.5
         self.assertEqual(qc.inverse(), expected)
 
+    def test_compare_two_equal_circuits(self):
+        """Test to compare that 2 circuits are equal.
+        """
+        qc1 = QuantumCircuit(2, 2)
+        qc1.h(0)
+
+        qc2 = QuantumCircuit(2, 2)
+        qc2.h(0)
+
+        self.assertTrue(qc1 == qc2)
+
+    def test_compare_two_different_circuits(self):
+        """Test to compare that 2 circuits are different.
+        """
+        qc1 = QuantumCircuit(2, 2)
+        qc1.h(0)
+
+        qc2 = QuantumCircuit(2, 2)
+        qc2.x(0)
+
+        self.assertFalse(qc1 == qc2)
+
+    def test_compare_a_circuit_with_none(self):
+        """Test to compare that a circuit is different to None.
+        """
+        qc1 = QuantumCircuit(2, 2)
+        qc1.h(0)
+
+        qc2 = None
+
+        self.assertFalse(qc1 == qc2)
+
 
 class TestCircuitBuilding(QiskitTestCase):
     """QuantumCircuit tests."""