Problem with products of boson.number operator in latest CUDA-Q

Hello,

When I am trying to run a multi-body dynamics simulation with the latest CUDA-Q version 0.12, I get an error whenever the Hamiltonian contains a product of two boson.number operators for the 3rd qubit and beyond, for example boson.number(index)*boson.number(index) where index>=2. The error message reads “Error in tensor callback: missing dimension for degree
#ERROR: Exception: #ERROR(CallbackError): External tensor callback function failed with error code 14
RuntimeError: [cudaq] %16 in computeImpl (line 92)”

No such error occurs for qubit index=0,1, or just the number operator itself (without product). The same simulation runs without issues on the older 0.10 version. Below is an example script to reproduce the error:

import numpy as np
import cudaq
from cudaq import boson, Schedule, ScipyZvodeIntegrator, spin, RungeKuttaIntegrator
import cupy as cp
import matplotlib.pyplot as plt

L=5
Nmax=1

cudaq.set_target(“dynamics”)

init=np.zeros(np.power(Nmax+1,L))
init[0]=1

index=3
hamiltonian = boson.number(index)*boson.number(index)

for i in range(L-1):
hamiltonian = hamiltonian + boson.identity(i)

dimensions={}
for i in range(L):
dimensions[i] = Nmax+1

rho0 = cudaq.State.from_data(
cp.array(init , dtype=cp.complex128))

t_final=25
n_steps=105

steps = np.linspace(0, t_final, n_steps)
schedule = Schedule(steps, [“t”])

evolution_result = cudaq.evolve(hamiltonian,
dimensions,
schedule,
rho0,
observables=,
collapse_operators=,
store_intermediate_results=True)

get_result = lambda idx, res: [
exp_vals[idx].expectation() for exp_vals in res.expectation_values()
]