Repository: Qiskit/qiskit

Issue:
Some controlled gates have ctrl_state parameters. Some not.

### What is the current behavior?

Based on https://github.com/Qiskit/qiskit-terra/issues/5098#issue-705776539

The `cx` method has `ctrl_state`  while `ccx` does not have that parameter.
```
from qiskit import QuantumCircuit

qc = QuantumCircuit(3)
qc.cx(0, 1, ctrl_state='0')
qc.ccx(0, 1, 2, ctrl_state='00')
```
```
TypeError: ccx() got an unexpected keyword argument 'ctrl_state'
```

### What is the expected behavior?

Consistency. Either the all controlled gate should have `ctrl_state` parameter  (vote with 🎉 ) or neither (vote with 🚀). 



Discussion:
Newcomer here. I am interested in taking this once we reach a decision! I can take the label issue at the same time.
All the control gates, like cu, cp, cry etc all have `ctrl_state` so I guess it would be preferable to add the same to ccx

Resolving patch:
diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py
--- a/qiskit/circuit/quantumcircuit.py
+++ b/qiskit/circuit/quantumcircuit.py
@@ -2779,11 +2779,21 @@ def dcx(self, qubit1, qubit2):
 
         return self.append(DCXGate(), [qubit1, qubit2], [])
 
-    def ccx(self, control_qubit1, control_qubit2, target_qubit):
+    def ccx(
+        self,
+        control_qubit1,
+        control_qubit2,
+        target_qubit,
+        ctrl_state=None,
+    ):
         """Apply :class:`~qiskit.circuit.library.CCXGate`."""
         from .library.standard_gates.x import CCXGate
 
-        return self.append(CCXGate(), [control_qubit1, control_qubit2, target_qubit], [])
+        return self.append(
+            CCXGate(ctrl_state=ctrl_state),
+            [control_qubit1, control_qubit2, target_qubit],
+            [],
+        )
 
     def toffoli(self, control_qubit1, control_qubit2, target_qubit):
         """Apply :class:`~qiskit.circuit.library.CCXGate`."""


Test patch:
diff --git a/test/python/circuit/test_controlled_gate.py b/test/python/circuit/test_controlled_gate.py
--- a/test/python/circuit/test_controlled_gate.py
+++ b/test/python/circuit/test_controlled_gate.py
@@ -865,7 +865,7 @@ def test_open_control_cy_unrolling(self):
         ref_circuit.append(U3Gate(np.pi, 0, np.pi), [0])
         self.assertEqual(uqc, ref_circuit)
 
-    def test_open_control_cxx_unrolling(self):
+    def test_open_control_ccx_unrolling(self):
         """test unrolling of open control gates when gate is in basis"""
         qreg = QuantumRegister(3)
         qc = QuantumCircuit(qreg)
@@ -884,6 +884,19 @@ def test_open_control_cxx_unrolling(self):
         ref_dag = circuit_to_dag(ref_circuit)
         self.assertEqual(unrolled_dag, ref_dag)
 
+    def test_ccx_ctrl_state_consistency(self):
+        """Test the consistency of parameters ctrl_state in CCX
+        See issue: https://github.com/Qiskit/qiskit-terra/issues/6465
+        """
+        qreg = QuantumRegister(3)
+        qc = QuantumCircuit(qreg)
+        qc.ccx(qreg[0], qreg[1], qreg[2], ctrl_state=0)
+
+        ref_circuit = QuantumCircuit(qreg)
+        ccx = CCXGate(ctrl_state=0)
+        ref_circuit.append(ccx, [qreg[0], qreg[1], qreg[2]])
+        self.assertEqual(qc, ref_circuit)
+
     def test_open_control_composite_unrolling(self):
         """test unrolling of open control gates when gate is in basis"""
         # create composite gate