# @OpName\_str not defined

**URL:** <https://itensor.discourse.group/t/opname-str-not-defined/2205>\
**Category:** ITensor Julia Questions\
**Created:** [January 20, 2025, 5:07pm UTC](https://itensor.discourse.group/t/opname-str-not-defined/2205 "2025-01-20T17:07:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfelmanl](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/dfelmanl/32/578_2.png) [@dfelmanl](https://itensor.discourse.group/u/dfelmanl)\
**Post date:** [January 20, 2025, 5:07pm UTC](https://itensor.discourse.group/t/opname-str-not-defined/2205/1 "2025-01-20T17:07:43Z")

</div>

Hi,

I just created a new environment and added ITensors. Then I tried to run the following line:

`ITensors.op(::OpName"I",::SiteType"Electron") = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`

, which gave the following error:

```auto
ERROR: LoadError: UndefVarError: `@OpName_str` not defined in `Main`

```

Any idea what could it be?

Thank you in advance,  
Daniel

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [January 20, 2025, 11:37pm UTC](https://itensor.discourse.group/t/opname-str-not-defined/2205/2 "2025-01-20T23:37:39Z")

</div>

`@OpName_str` and other functionality related to defining and constructing operators is no longer exported by ITensors.jl, you’ll have to load ITensorMPS.jl to access it.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/d3072b13e047cd06df7f3981547c0917d940dfa4.png) [@system](https://itensor.discourse.group/u/system)\
**Post date:** [January 30, 2025, 11:37pm UTC](https://itensor.discourse.group/t/opname-str-not-defined/2205/3 "2025-01-30T23:37:40Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
