Their tax liability is likely to be higher, too, another effect of marijuana’s dubious reputation. Certain jurisdictions tack a special-purpose tax onto the sales tax, Mr. Peterson noted. Oakland, Calif., for instance, adds 5 percent to the city’s regular 10 percent sales tax.

Just because marijuana can be sold legally in some states does not mean that Washington approves of the practice. It is still considered illegal drug trafficking under federal law, and the Internal Revenue Service taxes the industry accordingly. Section 280E of the Internal Revenue Code forbids businesses that traffic in controlled substances from deducting business expenses, apart from the cost of goods sold.

“That makes our business challenging,” Mr. Peterson said. “We’ve got all these states establishing laws, but we have to answer to federal authority on taxes. There’s no break or pass that any of us are getting.”

He is able to organize his operation to minimize the impact of 280E by ensuring that many of his expenses can be counted as costs of goods sold. He also takes care to distinguish production and sales of the drug from the rest of the business, the part that involves ancillary items, from which deductions are permitted.

The difficulties that growers and retailers face are being eased by a range of software systems tailored to the industry. With names like Proteus 420, BioTrack THC, MJ Freeway and BudMate POS, these systems track various bits of data related to plants and employees and help companies meet the onerous seed-to-sale requirements.

The software “helps business owners get away from the paperwork and grow their businesses,” said Kyle Sherman, chief executive of Flowhub, a Denver company that provides an application designed to “track plants throughout the life cycle” for growers and to aid retailers by logging sales of items that receive different tax treatment. His system also allows users to transmit information to state authorities, but so far only in Colorado and Oregon.

Josh Ginsberg, chief executive of Native Roots, an operator of marijuana retail outlets across Colorado, said he chose Flowhub’s system because of its utility in dealing with the state’s regulatory environment. Mr. Peterson at Terra Tech said he chose MJ Freeway, a much larger company, because he thought it would better meet the needs of a business that, like his, operates in several states.