Skip to content

YGate.power(1/2) behaves differently with scipy 1.14 on macOS #13305

@t-imamichi

Description

@t-imamichi

Environment

  • Qiskit version: 1.2.4
  • Python version: 3.12.7
  • Operating system: macOS 15.0.1

What is happening?

YGate.power(1/2) behaves differently with scipy 1.14 on macOS compared with outcomes with other version and OS.

How can we reproduce the issue?

import scipy
from qiskit.circuit.library import YGate

print('scipy', scipy.__version__)
print('Y^0.5', YGate().power(1 / 2))
print('Y^0.5 †', YGate().power(1 / 2).adjoint())

macOS + qiskit 1.2.4 + scipy 1.14.1

scipy 1.14.1
Y^0.5 Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5-0.5j,  0.5-0.5j],
       [-0.5+0.5j,  0.5-0.5j]])])
Y^0.5 † Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5+0.5j, -0.5-0.5j],
       [ 0.5+0.5j,  0.5+0.5j]])])

macOS + qiskit 1.2.4 + scipy 1.14.0

scipy 1.14.0
Y^0.5 Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5-0.5j,  0.5-0.5j],
       [-0.5+0.5j,  0.5-0.5j]])])
Y^0.5 † Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5+0.5j, -0.5-0.5j],
       [ 0.5+0.5j,  0.5+0.5j]])])

macOS + qiskit 1.2.4 + scipy 1.13.1

scipy 1.13.1
Y^0.5 Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5+0.5j, -0.5-0.5j],
       [ 0.5+0.5j,  0.5+0.5j]])])
Y^0.5 † Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5-0.5j,  0.5-0.5j],
       [-0.5+0.5j,  0.5-0.5j]])])

RedHat 9.4 + qiskit 1.2.4 + scipy 1.14.1

scipy 1.14.1
Y^0.5 Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5+0.5j, -0.5-0.5j],
       [ 0.5+0.5j,  0.5+0.5j]])])
Y^0.5 † Instruction(name='unitary', num_qubits=1, num_clbits=0, params=[array([[ 0.5-0.5j,  0.5-0.5j],
       [-0.5+0.5j,  0.5-0.5j]])])

What should happen?

Consistent outcomes regardless of scipy version

Any suggestions?

pin scipy version, e.g., scipy<1.14 for macOS?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions